OK, I take that back. Based on the MPI standard (age 488) only the thread that called MPI_Init or MPI_Init_thread must return true in this case. The logic I was exposing in my previous email is left to the user.
On Sep 4, 2013, at 12:11 , George Bosilca <bosilca_at_[hidden]> wrote:
> 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.
> On Sep 4, 2013, at 12:06 , Lisandro Dalcin <dalcinl_at_[hidden]> 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 :
>> 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