The caller of MPI_INIT_THREAD says what level of thread safety he would like to get from the MPI implementation. The implementation says what level of thread safety it provides.
The implementation is free to provide more or less thread safety than requested. The caller of MPI_INIT_THREAD should look at the level the implementation says it is providing and act accordingly. If the application needs and asks for THREAD_MULTIPLE and gets less than THREAD_MULTIPLE, it must terminate itself. If the application has a preferred mode that uses THREAD_MULTIPLE and a mode that uses FUNNELED then when the MPI_INIT_THREAD call returns FUNNELED, the application must adopt the FUNNELED mode.
An application that asks for THREAD_SINGLE may hope there is a THREAD_SINGLE mode that gives better performance but nothing in a THREAD_SINGLE application can be made incorrect by an implementation providing THREAD_MULTIPLE.
If the application will make MPI calls from multiple threads and MPI_INIT_THREAD has returned FUNNELED, the application must be willing to take the steps that ensure there will never be concurrent calls to MPI from the threads. The threads will take turns - without fail.
Dick Treumann - MPI Team
IBM Systems & Technology Group
Dept X2ZA / MS P963 -- 2455 South Road -- Poughkeepsie, NY 12601
Tele (845) 433-7846 Fax (845) 433-8363
email@example.com wrote on 03/03/2010 11:59:45 AM:
> [image removed]
> Re: [OMPI users] MPI_Init() and MPI_Init_thread()
> Brian Budge
> Open MPI Users
> 03/03/2010 12:04 PM
> Sent by:
> Please respond to Open MPI Users
> I believe that it specifies the *minimum* threading model
> supported. If I recall, opmi is already funnel safe even in single
> mode. However, if mpi calls are made from outside the main thread,
> you should specify funneled for portability
> On Mar 2, 2010 11:59 PM, "Terry Frankcombe" <firstname.lastname@example.org> wrote:
> I can't speak for the developers. However, I think it's to do with the
> library internals.
> >From here: http://www.mpi-forum.org/docs/mpi-20-html/node165.htm
> "Advice to implementors.
> "If provided is not MPI_THREAD_SINGLE then the MPI library should not
> invoke C/ C++/Fortran library calls that are not thread safe, e.g., in
> an environment where malloc is not thread safe, then malloc should not
> be used by the MPI library.
> "Some implementors may want to use different MPI libraries for different
> levels of thread support. They can do so using dynamic linking and
> selecting which library will be linked when MPI_INIT_THREAD is invoked.
> If this is not possible, then optimizations for lower levels of thread
> support will occur only when the level of thread support required is
> specified at link time. ( End of advice to implementors.)"
> On Wed, 2010-03-03 at 16:33 +0900, Yuanyuan ZHANG wrote:
> > Hi all,
> > I am a beginner of MPI an..._______________________________________________
> users mailing list