Open MPI logo

Open MPI User's Mailing List Archives

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

From: Xiaoning (David) Yang (xyang_at_[hidden])
Date: 2006-03-06 11:21:15


Jeff,

Thank you for the reply. In other words, MPI_IN_PLACE only eliminates data
movement on root, right?

David

***** Correspondence *****

> From: Jeff Squyres <jsquyres_at_[hidden]>
> Reply-To: Open MPI Users <users_at_[hidden]>
> Date: Fri, 3 Mar 2006 19:18:52 -0500
> To: Open MPI Users <users_at_[hidden]>
> Subject: Re: [OMPI users] MPI_IN_PLACE
>
> On Mar 3, 2006, at 6:42 PM, Xiaoning (David) Yang wrote:
>
>> call MPI_REDUCE(mypi,pi,1,MPI_DOUBLE_PRECISION,MPI_SUM,0,
>> & MPI_COMM_WORLD,ierr)
>>
>> Can I use MPI_IN_PLACE in the MPI_REDUCE call? If I can, how?
>> Thanks for any help!
>
> MPI_IN_PLACE is an MPI-2 construct, and is defined in the MPI-2
> standard. Its use in MPI_REDUCE is defined in section 7.3.3:
>
> http://www.mpi-forum.org/docs/mpi-20-html/node150.htm#Node150
>
> It says:
>
> "The ``in place'' option for intracommunicators is specified by
> passing the value MPI_IN_PLACE to the argument sendbuf at the root.
> In such case, the input data is taken at the root from the receive
> buffer, where it will be replaced by the output data."
>
> In the simple pi example program, it doesn't make much sense to use
> MPI_IN_PLACE except as an example to see how it is used (i.e., it
> won't gain much in terms of efficiency because you're only dealing
> with a single MPI_DOUBLE_PRECISION). But you would want to put an
> "if" statement around the call to MPI_REDUCE and pass MPI_IN_PLACE as
> the first argument, and mypi as the second argument for the root.
> For all other processes, use the same MPI_REDUCE that you're using now.
>
> --
> {+} Jeff Squyres
> {+} The Open MPI Project
> {+} http://www.open-mpi.org/
>
>
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users