Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] RE : Problems with MPI_Init_Thread(...)
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2011-09-19 09:02:43

On Sep 19, 2011, at 8:37 AM, Sébastien Boisvert wrote:

> You need to call MPI_Init before calling MPI_Init_thread.

This is incorrect -- MPI_INIT_THREAD does the same job as MPI_INIT, but it allows you to request a specific thread level.

> According to (Past MPI Mechanic Columns written by Jeff Squyres)
> only 3 functions that can be called before calling MPI_Init and they are:
> - MPI_Initialized
> - MPI_Finalized
> - MPI_Get_version

Ouch -- using my own words against me. :-)

I unfortunately was using shorthand here because I equate MPI_INIT and MPI_INIT_THREAD in my head. Think of that text as "before calling MPI_Init or MPI_Init_thread..."

> This information is also listed in Section 8.7 (page 291) in the MPI 2.2 book ( ).

Page 291 of MPI-2.2 for me says the following:

All MPI programs must contain exactly one call to an MPI initialization routine: MPI_INIT or MPI_INIT_THREAD. Subsequent calls to any initialization routines are erro- neous. The only MPI functions that may be invoked before the MPI initialization routines are called are MPI_GET_VERSION, MPI_INITIALIZED, and MPI_FINALIZED.

>> I build my application, and run it on 3 nodes. However, I get this error:
>> Sun Sep 18 22:25:11 2011[1,1]<stderr>:*** The MPI_Init_thread() function was called before MPI_INIT was invoked.
>> Sun Sep 18 22:25:11 2011[1,1]<stderr>:*** This is disallowed by the MPI standard.
>> Sun Sep 18 22:25:11 2011[1,1]<stderr>:*** Your MPI job will now abort.
>> Sun Sep 18 22:25:11 2011[1,1]<stderr>:[Morpheus.OTZ:9910] Abort before MPI_INIT completed successfully; not able to guarantee that all other processes were killed!

Hmm; this is very strange and potentially misleading. Clearly, MPI_INIT_THREAD is allowed to be the first function. I'm not entirely sure why you're seeing this message.

Do you have the same version and configuration of Open MPI installed and found in default paths on all of your nodes?

Jeff Squyres
For corporate legal information go to: