[mpich-discuss] What is the difference between MPI_THREAD_SINGLE and MPI_THREAD_FUNNELED

Balaji, Pavan balaji at anl.gov
Sun Jun 1 19:58:43 CDT 2014


On May 30, 2014, at 12:30 PM, Boisvert, Sebastien <boisvert at anl.gov> wrote:
> On Friday, May 30, 2014 12:26 PM, discuss-bounces at mpich.org [discuss-bounces at mpich.org] on behalf of Rajeev Thakur [thakur at mcs.anl.gov] wrote:
>> To: discuss at mpich.org
>> Subject: Re: [mpich-discuss] What is the        difference      between MPI_THREAD_SINGLE and MPI_THREAD_FUNNELED
>> 
>> It shouldn't, but what does it return in your program?
> 
> I am currently using MPI_Init (I thought it was OK if only the main thread calls MPI functions).
> 
> Code-> https://github.com/GeneAssembly/biosal/blob/master/engine/node.c#L33

If you initialize with MPI_INIT, the MPI implementation can choose to provide whatever thread-level it likes.  There are two options for you:

Option 1:

MPI_INIT  /* tell MPI to give you what it can */
MPI_QUERY_THREAD /* ask for what you got */
if (less than FUNNELED) abort;

Option 2:

MPI_INIT_THREAD(FUNNELED, &provided); /* tell MPI to give you FUNNELED */
if (provided < FUNNELED) abort;

Option 2 is cleaner since you gave MPI a hint that you would like to have FUNNELED level.

  — Pavan




More information about the discuss mailing list