[mpich2-dev] translating process ranks

Darius Buntinas buntinas at mcs.anl.gov
Wed Dec 15 16:50:55 CST 2010


A process group corresponds to a comm_world.  You can have more than one comm_world when you spawn processes.  Of course each process belongs to only one comm_world, but it can communicate with processes in another comm_world.

This is why rank alone cannot uniquely identify a process.  You need to know which comm_world it's in.  Inside MPICH, we use pg_id and pg_rank to uniquely identify a process.

Of course if you're not dealing with dynamic processes, then you don't have to worry about that.

-d

On Dec 15, 2010, at 4:45 PM, Thomas Ropars wrote:

> Thank you. That's what I was looking for :).
> 
> I thought of that but I wasn't sure to understand clearly what pg_rank is.
> The comment says "Rank of the process in that process group associated with this VC". And so i was wondering if it could be another process group than the one of MPI_COMM_WORLD.
> 
> Thomas
> 
> On 15/12/2010 16:35, Darius Buntinas wrote:
>> If you want to do this from inside the library you can do it this way:
>> 
>>     MPIDI_VC_t *vc;
>>     MPIDI_Comm_get_vc(comm, rank,&vc);
>>     comm_world_rank = vc->pg_rank;
>> 
>> -d
>> 
>> On Dec 15, 2010, at 3:49 PM, David Fiala wrote:
>> 
>>> Thomas,
>>> 
>>> I've found that using the combination of MPI_Comm_group with
>>> MPI_Group_translate_ranks works for this purpose.
>>> 
>>> -David Fiala
>>> 
>>> On Wed, Dec 15, 2010 at 4:43 PM, Thomas Ropars<thomas.ropars at inria.fr>  wrote:
>>>> Hi,
>>>> 
>>>> Is there a function in mpich2 that can takes as input a communicator and a
>>>> rank provides as output the rank of the process in MPI_COMM_WORLD?
>>>> If not, what would be the easiest way to do it ?
>>>> 
>>>> Regards,
>>>> Thomas
>>>> 
>> 
> 



More information about the mpich2-dev mailing list