Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] MPI_Init() and MPI_Init_thread()
From: Dave Goodell (goodell_at_[hidden])
Date: 2010-03-04 12:15:22

On Mar 4, 2010, at 10:52 AM, Anthony Chan wrote:

> ----- "Yuanyuan ZHANG" <zhang.yuanyuan_at_[hidden]> wrote:
>> For an OpenMP/MPI hybrid program, if I only want to make MPI calls
>> using the main thread, ie., only in between parallel sections, can
>> I just
>> use SINGLE or MPI_Init?
> If your MPI calls is NOT within OpenMP directives, MPI does not even
> know you are using threads. So calling MPI_Init is good enough.

This is *not true*. Please read Dick's previous post for a good
example of why this is not the case.

In practice, on most platforms, implementation support for SINGLE and
FUNNELED are identical (true for stock MPICH2, for example). However
Dick's example of thread-safe versus non-thread-safe malloc options
clearly shows why programs need to request (and check "provided" for)
>=FUNNELED in this scenario if they wish to be truly portable.