Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: [OMPI users] Multi-threading with OpenMPI ?
From: Ashika Umanga Umagiliya (aumanga_at_[hidden])
Date: 2009-09-10 23:46:16

Greetings all,

Please refer to image at:

Here the process illustrated in the image:

1) C++ Webservice loads the "" when it starts up. (dlopen)
2) When a new request comes from a client,*new thread* is created, SOAP
data is bound to C++ objects and calcRisk() method of webservice
invoked.Inside this method, "calcRisk()" of "libParallel" is invoked
(using dlsym ..etc)
3) Inside "calcRisk()" of "libParallel" ,it spawns "parallel-svr" MPI
(I am using boost MPI and boost serializarion to send custom-data-types
across spawned processes.)
4) "parallel-svr" (MPI Application in image) execute the parallel logic
and send the result back to "" using boost MPI send..etc.
5) "" send the result to webservice,bind into SOAP and
sent result to client and the thread ends.

My problem is :

Everthing works fine for the first request from the client,
For the second request it throws an error (i assume from") saying:

Calling any MPI-function after calling MPI_Finalize is erroneous.
The only exceptions are MPI_Initialized, MPI_Finalized and MPI_Get_version.
*** An error occurred in MPI_Init
*** after MPI was finalized
*** MPI_ERRORS_ARE_FATAL (your MPI job will now abort)
[umanga:19390] Abort after MPI_FINALIZE completed successfully; not able
to guarantee that all other processes were killed!"

Is this because of multithreading ? Any idea how to fix this ?

Thanks in advance,