[mvapich-discuss] Stupid question about MPI Communicators

James Dinan dinan at mcs.anl.gov
Tue Jun 14 17:58:23 EDT 2011


Hi Mike,

The context ID is a logical component of a communicator; you don't 
interact with it directly in MPI.  I only mentioned it to help explain 
the role of communicators in a communication operation, which may have 
added to confusion rather than helping.

Back to your original question: MPI communication is effectively 
sandboxed within a communicator and stays within the confines of that 
communication context.  When you create a communicator, the processes in 
the new communicator get a handle for the same new communication sandbox 
and can use this space to talk to each other.  Whether two communicators 
contain the same list of processes or not has no bearing on the 
sandboxing effect of the communicator.

Consider, for example, a math library that uses MPI.  The library needs 
to do communication internally but is not sure which tags might already 
be in use by the application.  The library should duplicate 
(MPI_Comm_dup) MPI_COMM_WORLD and communicate on the duplicate so that 
its communication cannot interfere with the application's communication.

Best,
  ~Jim.

On 6/14/11 1:24 PM, Mike Heinz wrote:
> Jim,
>
> If I have an MPI job running across multiple physical nodes, how do they ensure they get the same context id?
>
> -----Original Message-----
> From: mvapich-discuss-bounces at cse.ohio-state.edu [mailto:mvapich-discuss-bounces at cse.ohio-state.edu] On Behalf Of James Dinan
> Sent: Thursday, June 09, 2011 3:37 PM
> To: mvapich-discuss at cse.ohio-state.edu
> Subject: Re: [mvapich-discuss] Stupid question about MPI Communicators
>
> Hi Mike,
>
> Nope, communication cannot pass from one communicator into another.
> Communicators contain both a group and a context ID and this context ID is effectively used as a second tag when matching communication operations.  If you were to call MPI_Comm_compare on such communicators, MPI will tell you MPI_CONGRUENT if both communicators were built with the same MPI group or MPI_SIMILAR, but not MPI_IDENT(ical).
>
> Best,
>    ~Jim.
>
> On 6/9/11 1:28 PM, Mike Heinz wrote:
>> If I create two communicators with the exact same members, are they considered to be the same communicator?  That is, if I create Communicator A and Communicator B with the same members, and Rank-a sends via A, will Rank b receive it while listening to Communicator B?
>>
>> This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
>>
>>
>> _______________________________________________
>> mvapich-discuss mailing list
>> mvapich-discuss at cse.ohio-state.edu
>> http://mail.cse.ohio-state.edu/mailman/listinfo/mvapich-discuss
>
> _______________________________________________
> mvapich-discuss mailing list
> mvapich-discuss at cse.ohio-state.edu
> http://mail.cse.ohio-state.edu/mailman/listinfo/mvapich-discuss
>
>
> This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
>



More information about the mvapich-discuss mailing list