LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Brian Barrett (brbarret_at_[hidden])
Date: 2007-09-30 00:01:08


On Sep 29, 2007, at 1:27 PM, XMATX_at_[hidden] wrote:

> in C i used an own variable MPI_Comm comm;
> How can i do this in C++ ? I try something like MPI::COMM_WORLD comm;
> But this does not work.
>
> Am i able to define an own Communicator? Or is it slower if i use
> in every MPI-routine call something like
> MPI::COMM_WORLD.<routine> ?
>
> What i wanted was this:
> MPI::COMM_WOLRD comm;
>
> function(comm);
>
>
> //somewhere in function:
> comm.Send(...);
>
> Is this possible?

MPI::COMM_WORLD is a global instance of type MPI::Intercomm. The C++
bindings deal with intercommunicators and intracommunicators
differently at the type level (although both inherit from
MPI::Comm). So you would want to do:

MPI::Intercomm comm;

Good luck,

Brian