Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: Re: [OMPI users] Multiple Communicators for communication
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2012-06-15 06:40:17

On Jun 14, 2012, at 8:43 PM, Ramesh Vinayagam wrote:

> I was wondering is there a way to communicate between two processes with two different communicators simultaneously in MPI? Like having two channels for communication?

I'm not quite sure what you're asking. Are you asking if it's possible to have 2 processes share 2 entirely different communicators (and use both of them for communication)?

If so, yes. Any set of processes can have any number of shared communicators. For example:

   MPI_Comm foo;
   MPI_Comm_dup(MPI_COMM_WORLD, &foo);

Now foo will be a duplicate of MPI_COMM_WORLD, but with a different communication context (so that messages sent on MCW won't be received on foo, and vice versa). Hence, you can send a message on MCW to any peer in that communicator, but you can also send a message on foo to any peer in that communicator.

Note, however, that sending multiple messages on different communicators to the same peer doesn't (usually) expand your available bandwidth. Think of communicators (and tags, too), as message matching mechanisms rather than bandwidth-multiplying mechanisms. For example, you might send control messages on "foo", but send data messages on MPI_COMM_WORLD.

Hope that helps.

Jeff Squyres
For corporate legal information go to: