Open MPI logo

Open MPI User's Mailing List Archives

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

From: George Bosilca (bosilca_at_[hidden])
Date: 2007-08-10 17:50:42

MPI is process based and not thread based. So there is no way in MPI
to synchronize several threads. Moreover, all threads in a process
will return the same rank [as you noticed].

Synchronizations internal to a process have to be done outside MPI.
Any threading library, such as pthread library, is the way to go.


On Aug 10, 2007, at 3:57 PM, Yuan, Huapeng wrote:

> Hi,
> Can I use openmpi API like MPI_Reduce or MPI_Gather to synchronize
> multiple theads in a process?
> In my test in redhat linux, MPI_Comm_rank return 0 for all threads in
> the same process. If I want to use the MPI functions like
> MPI_Reduce or
> MPI_Gather, the rank number shoule be different for each threads.
> Do you have any suggestions? Thanks.
> Hua
> _______________________________________________
> users mailing list
> users_at_[hidden]

  • application/pkcs7-signature attachment: smime.p7s