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_Bcast vs. per worker MPI_Send?
From: David Zhang (solarbikedz_at_[hidden])
Date: 2010-12-13 20:21:13


Unless your cluster has some weird connection topology and you're trying to
take advantage of that, collective is the best bet.

On Mon, Dec 13, 2010 at 4:26 PM, Eugene Loh <eugene.loh_at_[hidden]> wrote:

> David Mathog wrote:
>
> Is there a rule of thumb for when it is best to contact N workers with
>> MPI_Bcast vs. when it is best to use a loop which cycles N times and
>> moves the same information with MPI_Send to one worker at a time?
>>
>>
> The rule of thumb is to use a collective whenever you can. The rationale
> is that the programming should be easier/cleaner and the underlying MPI
> implementation has the opportunity to do something clever.
>
>
> For that matter, other than the coding semantics, is there any real
>> difference between the two approaches? That is, does MPI_Bcast really
>> broadcast, daisy chain, or use other similar methods to reduce bandwidth
>> use when distributing its message, or does it just go ahead and run
>> MPI_Send in a loop anyway, but hide the details from the programmer?
>>
>> I believe most MPI implementations, including OMPI, make an attempt to
> "do the right thing". Multiple algorithms are available and the best one is
> chosen based on run-time conditions.
>
> With any luck, you're better off with collective calls. Of course, there
> are no guarantees.
>
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users
>

-- 
David Zhang
University of California, San Diego