Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: Re: [OMPI users] Does OpenMPI's MPI_Barrier automatically call thetuned version?
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2009-03-27 22:12:09

On Mar 23, 2009, at 6:02 AM, Shanyuan Gao wrote:

> Here I am again with questions about MPI_Barrier. I did some
> benchmark on MPI_Barrier and wondered if OpenMPI's
> implementation automatically calls the tuned version of MPI_Barrier,
> e.g. tree algorithm, when the number of nodes exceeds 4?

Yes, the tuned component should usually be the default. There are a
few cases where it might not be -- e.g., in MPI_COMM_SELF, the "self"
coll component should bump its priority up high enough to be the
default (in which case a barrier is a no-op).

(this conversation might be better on the devel list...?)

To be specific, Open MPI goes through a selection process to determine
which coll component should be used on a per-communicator basis. But
it's not as simple as a "component X had the highest priority, so we
use all of its functions" -- that would be too easy. ;-) Instead, we
actually allow components to specify less than all of the collective
functions (E.g., you can write a coll component with just a new
barrier function and supply NULL for the rest). During the selection
process, the coll base prioritizes each available component in
priority order. Starting with the lowest priority component, it saves
all the function pointers provided by that component. Then it goes to
the next highest priority and repeats (potentially overwriting
function pointers from the lower priority component). And so on,
until all available components are done.

When we're done, we may have a mish-mash of function pointers from
different components. See the comments in these files for more details:

Jeff Squyres
Cisco Systems