[mpich-discuss] finding the rank of processes from their environment?

Jeff Hammond jeff.science at gmail.com
Sun Feb 3 23:42:47 CST 2019


PMI_RANK and PMI_SIZE look to me like what you want and one of my Intel
colleagues had the same answer in response to a similar question regarding
Intel MPI, which also uses Hydra (
https://software.intel.com/en-us/forums/intel-clusters-and-hpc-technology/topic/703734
).

I'm sure you know that all of this is non-standard and relying on it is
inherently non-portable.

Jeff

On Sun, Feb 3, 2019 at 1:40 PM Brice Goglin via discuss <discuss at mpich.org>
wrote:

> Hello
>
> Is there a way to find out the rank of a process (in COMM_WORLD) by
> looking at its environment? We use this feature in OpenMPI and srun for
> displaying the placement of ranks in hwloc tools. By default, we display
> the PID, but displaying the commworld rank is more useful. Looking in
> /proc/<pid>/environ is an easy way to find environment variables, but I
> could not find a clear solution for MPICH.
>
> I tried on several machines with different mpich installations. In one
> case, I found a MPI_LOCALRANKID (which isn't exactly what I want but
> could be sufficient). There's also PMI_RANK, which may be identical to
> the commworld rank?
>
> Thanks for the help
>
> Brice
>
>
>
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
>


-- 
Jeff Hammond
jeff.science at gmail.com
http://jeffhammond.github.io/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20190203/288c7931/attachment.html>


More information about the discuss mailing list