You're in the SERIALIZED mode, so any thread can make MPI calls. As in such mode there is no notion of thread_main, consistently returning true out of MPI_Is_thread_main seem like a reasonable approach.
This function will have a different behavior in the FUNNELED mode. George. On Sep 4, 2013, at 12:06 , Lisandro Dalcin <dalc...@gmail.com> wrote: > I'm using Open MPI 1.6.5 as packaged in Fedora 19. This build does not > enable THREAD_MULTIPLE support: > > $ ompi_info | grep Thread > Thread support: posix (MPI_THREAD_MULTIPLE: no, progress: no) > > In my code I call MPI_Init_thread(required=MPI_THREAD_MULTIPLE). After > that, MPI_Query_thread() returns MPI_THREAD_SERIALIZED. But calling > MPI_Is_thread_main() always return TRUE, either in the main thread or > in newly spawned threads. > > I think this code is wrong for the case provided==MPI_THREAD_SERIALIZED : > https://bitbucket.org/ompiteam/ompi-svn-mirror/src/0a159982d7204d4b4b9fa61771d0fc7e9dc16771/ompi/mpi/c/is_thread_main.c?at=default#cl-50 > > > -- > Lisandro Dalcin > --------------- > CIMEC (INTEC/CONICET-UNL) > Predio CONICET-Santa Fe > Colectora RN 168 Km 472, Paraje El Pozo > 3000 Santa Fe, Argentina > Tel: +54-342-4511594 (ext 1011) > Tel/Fax: +54-342-4511169 > _______________________________________________ > devel mailing list > de...@open-mpi.org > http://www.open-mpi.org/mailman/listinfo.cgi/devel