LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Kyle Wheeler (kbwheel_at_[hidden])
Date: 2006-08-03 17:29:51


On Thursday, August 3 at 04:15 PM, quoth Anthony Chan:
> On Thu, 3 Aug 2006, Kyle Wheeler wrote:
>
>> On Thursday, August 3 at 04:13 PM, quoth Kyle Wheeler:
>>> I'm fiddling with the profiling layer, and I want to convert a
>>> communicator-specific rank to global rank. Is there a good way of
>>> doing this?
>>
>> I found the following, which I think does it. Is this the best way?
>>
>> MPI_Group world, cur;
>> int globalrank;
>> PMPI_Comm_group(comm, &cur);
>> PMPI_Comm_group(MPI_COMM_WORLD, &world);
>> PMPI_Group_translate_ranks(cur, 1, &rank, world, &globalrank);
>
> The simplest way is to call MPI_Comm_rank twice.
>
> PMPI_Comm_rank( MPI_COMM_WORLD, &world_rank );
> PMPI_Comm_rank( comm, &comm_rank );
>
> PMPI_Group_translate_ranks() becomes more efficient if you have a group
> of ranks to be translated (i.e. save you a Comm_group() call).

Really? Umm... I'm not sure that does what I want (or maybe I'm just
not understanding what PMPI_Comm_rank() does). I *have* an arbitrary
rank (the destination argument of an MPI_Send, for example) and I want
to, inside the profiling layer, convert that destination rank into a
rank in MPI_COMM_WORLD. I don't see where it's taking my arbitrary
rank as input somewhere.

If PMPI_Group_translate_ranks() is inefficient... perhaps I should
build up my own translation tables?

-- 
Kyle B. Wheeler                           Scalable Computing Systems (1423)
Student Intern                                 Sandia National Laboratories
kbwheel_at_[hidden]                                             505-844-7179
MS: 1319                                                           CSRI/237


  • application/pgp-signature attachment: stored