I am building an application which uses MPI_Ssend(...) and MPI_Recv(...)
in threads. So, there is more than one thread which invokes MPI
Based on Jeff's inputs, I rebuilt open-mpi with threads support:
./configure --enable-mpi-threads=yes --with-threads=posix ...
I believe the above line would do the magic.
Now, I learnt that I need to request thread support when initializing MPI
application using MPI_Init_thread(...). This is my code fragment:
int main(int argc, char *argv)
int desired_thread_support = MPI_THREAD_MULTIPLE;
MPI_Init_thread(&argc, &argv, desired_thread_support, &provided_thread_support);
I build my application, and run it on 3 nodes. However, I get this error:
Sun Sep 18 22:25:11 2011[1,1]<stderr>:*** The MPI_Init_thread() function was called before MPI_INIT was invoked.
Sun Sep 18 22:25:11 2011[1,1]<stderr>:*** This is disallowed by the MPI standard.
Sun Sep 18 22:25:11
2011[1,1]<stderr>:*** Your MPI job will now abort.
Sun Sep 18
22:25:11 2011[1,1]<stderr>:[Morpheus.OTZ:9910] Abort before
MPI_INIT completed successfully; not able to guarantee that all other
processes were killed!
I did read some online examples, and API documentations, and nothing says that I will need to call MPI_Init(...) *followed by*
I have open-mpi 1.4.3 from open-mpi official site, running on Linux kernel 220.127.116.11-0.7.
I do not understand why this error is happening.
Again, the next question is, Am I required to MPI_Init_thread everytime I
create a new thread? If yes, will this call be the first line in the
Would be nice if someone can throw some pointers.
Thanks a lot.