[Mpi-forum] Threading guarantees of MPI_User_function

William Gropp wgropp at illinois.edu
Thu May 25 18:58:13 CDT 2017

Just to be clear on this, the MPI standard generally requires the user to enforce any synchronization needed when using threads with MPI, so Jeff’s answer is aligned with the standard.


William Gropp
Interim Director and Chief Scientist, NCSA
Thomas M. Siebel Chair in Computer Science
University of Illinois Urbana-Champaign

> On May 25, 2017, at 1:49 PM, Phil Ruffwind <rf at rufflewind.com> wrote:
> On Thu, May 25, 2017, at 12:55, Jeff Hammond wrote:
>> I expect that MPI_User_function is invoked by the thread that invokes the
>> MPI function that uses it, and that you need a mutex to touch shared
>> state
>> associated with MPI_User_function when running with MPI_THREAD_MULTIPLE,
>> but not otherwise.
>> I would hope that MPI implementations do not serialize calls to
>> MPI_User_function
>> in MPI_THREAD_MULTIPLE mode, because there are many cases where
>> MPI_User_function
>> is trivially reentrant and I would like simultaneous progress if I call
>> MPI_Allreduce concurrently from 2+ threads (with different communicators,
>> of course) with the same MPI_User_function.
> Thanks for clarifying.  In that case, I'll assume synchronization is
> necessary.
> _______________________________________________
> mpi-forum mailing list
> mpi-forum at lists.mpi-forum.org
> https://lists.mpi-forum.org/mailman/listinfo/mpi-forum

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpi-forum.org/pipermail/mpi-forum/attachments/20170525/595d3651/attachment-0001.html>

More information about the mpi-forum mailing list