Re: [Mpi-forum] Threading guarantees of MPI_User_function
It sounds like we need to add some text to the standard about this. At the very least, an advice to users about the thread context seems prudent. Can you add a ticket about this? Collectives WG seems like the right place... Jeff Sent from my iPhone
On May 29, 2017, at 9:18 AM, "[email protected]" <[email protected]> wrote:
I’m sorry but the MPI_User_function is not always invoked by the thread that invokes the MPI function that uses it. When you have progression thread, the MPI_User_function may be called by this additional thread.
Marc
De : [email protected] [mailto:[email protected]] De la part de William Gropp Envoyé : vendredi 26 mai 2017 01:58 À : Main MPI Forum mailing list Objet : Re: [Mpi-forum] Threading guarantees of MPI_User_function
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.
Bill
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 <[email protected]> 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 [email protected] https://lists.mpi-forum.org/mailman/listinfo/mpi-forum
_______________________________________________ mpi-forum mailing list [email protected] https://lists.mpi-forum.org/mailman/listinfo/mpi-forum
participants (1)
-
Jeff Hammond