You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have try to change the implementation of Grappa to be multithreaded, but I encountered some problems. Could you give me some help?
I mainly modify the code in this commit buaasun@02c397b
When I run the modified version of helloworld, sometimes it can finish all tasks, but sometimes it failed randomly. I guess the problem is in swap_context.
However, it is difficult to debug the problem, because the call stack is broken when the problem happen. I find nothing in gdb backtrace. I have no idea to solve the problem, so I really need your help @bmyerz@nelsonje
BTW. I found a similar project https://github.com/Qthreads/qthreads. It is multithreaded. So I think it should be no problem to change Grappa to be multithreaded.
The text was updated successfully, but these errors were encountered:
Look, I don't want to be offensive, but this is a bad idea, you're unlikely to succeed, and I don't know what you would get from it that Grappa doesn't already provide.
Grappa is based on a process-per-core model. We run our own lightweight threads within each process, but all bound to a single core. This allows the scheduler and the communication layer to make many assumptions about the state of caches, about the replication of private per-core data structrues, and about the atomicity of execution of various routines. The Grappa code assumes this process-per-core property is true in dozens, if not hundreds, of places. Changing to a multithreaded model would a huge number of changes to some very tricky pieces of code. It's certainly possible, but it would be super-hard and take a very long time, even for me.
The last time you asked us a question, it sounded like you were having trouble running jobs that made use of multiple cores on each node. You do not need to add threading to Grappa to do this; it is already supported, and is how we collected all the data in our papers.
If you want to run on a cluster with multicore machines, you simply run multiple processes per node using your MPI job launcher. Those processes will find each other using MPI, and allocate shared memory regions for faster inter-core communication within a node, all automatically (assuming your MPI implementation is configured correctly). Then you just have to expose parallelism using Grappa's APIs, and work will be spread across all the cores on all the nodes in your jobs. There are lots of examples of this in the /applications directory.
What is it that you're trying to accomplish with this?
I have try to change the implementation of Grappa to be multithreaded, but I encountered some problems. Could you give me some help?
I mainly modify the code in this commit buaasun@02c397b
When I run the modified version of
helloworld
, sometimes it can finish all tasks, but sometimes it failed randomly. I guess the problem is inswap_context
.However, it is difficult to debug the problem, because the call stack is broken when the problem happen. I find nothing in
gdb backtrace
. I have no idea to solve the problem, so I really need your help @bmyerz @nelsonjeBTW. I found a similar project https://github.com/Qthreads/qthreads. It is multithreaded. So I think it should be no problem to change Grappa to be multithreaded.
The text was updated successfully, but these errors were encountered: