[mpich-discuss] get the process rank in the bash script

Jeff Hammond jhammond at alcf.anl.gov
Tue Apr 30 10:30:04 CDT 2013


If you are on a Cray machine, why are you not using the appropriate
launcher, aprun?

You can find some info on parsing Cray physical topology on
https://wiki.alcf.anl.gov/parts/index.php/Cray.  For example, the
physical node id, which may not correspond with what PMI gives you
inside of a parallel job, can be read from /proc/cray_xt/nid on every
node in the system, including both compute and service nodes.

I can't tell exactly what you are doing, but if you are using CSCS,
you might find CSCS support is able to better address your needs.  In
many cases, there is a "better way" to do things on a supercomputer
than what one uses on traditional Linux clusters.

Jeff

On Mon, Apr 29, 2013 at 9:12 PM, Pavan Balaji <balaji at mcs.anl.gov> wrote:
> Hello,
>
> Adding discuss at mpich.org back to cc.
>
> There is a second alternative -- PMI_ID -- that you might want to try.
> If that doesn't work, Cray might be using something different and you'll
> need to check with them.
>
>  -- Pavan
>
> On 04/29/2013 02:22 AM US Central Time, Kirill Lykov wrote:
>> Thanks for the reply, I'm working on the Cray machine so the MPICH2 version for cray is defined by the following line: CRAY_MPICH2_VERSION=5.6.0
>>
>>
>> ________________________________________
>> From: Pavan Balaji [balaji at mcs.anl.gov]
>> Sent: Monday, April 29, 2013 12:13 AM
>> To: discuss at mpich.org
>> Cc: Lykov Kirill
>> Subject: Re: [mpich-discuss] get the process rank in the bash script
>>
>> You can use PMI_RANK.  I just tried it and it works as expected.  Which
>> version of MPICH are you using?
>>
>>  -- Pavan
>>
>> On 02/25/2013 10:06 AM US Central Time, Kirill Lykov wrote:
>>> Dear mpich users,
>>>
>>> I'm looking for an environmental variable which can be used in a bash script to identify the process rank.
>>> I launch a bash script using mpi:
>>> mpirun ./my-script.sh
>>>
>>> In my-script I want to use the rank of the process to identify which input file to use. In OpenMPI, I used OMPI_COMM_WORLD_RANK and my-script.sh looked like the following:
>>>
>>> inputName="MyInput_$OMPI_COMM_WORLD_RANK"./myexe $inputName
>>>
>>> What can be used in MPICH instead of OMPI_COMM_WORLD_RANK? I found somewhere that $PMI_RANK is the same but I found that it is empty.
>>>
>>> Kirill Lykov, Mr.
>>>
>>> Doctoral Assistant
>>> Institute of
>>> Computational Science
>>> Faculty of Informatics
>>> Università della Svizzera italiana, USI
>>> Via G. Buffi 13
>>> CH - 6904 Lugano
>>> (e) kirill.lykov at usi.ch
>>> (t) +41 (0) 788413392
>>>
>>>
>>> _______________________________________________
>>> discuss mailing list     discuss at mpich.org
>>> To manage subscription options or unsubscribe:
>>> https://lists.mpich.org/mailman/listinfo/discuss
>>>
>>
>> --
>> Pavan Balaji
>> http://www.mcs.anl.gov/~balaji
>>
>
> --
> Pavan Balaji
> http://www.mcs.anl.gov/~balaji
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss



-- 
Jeff Hammond
Argonne Leadership Computing Facility
University of Chicago Computation Institute
jhammond at alcf.anl.gov / (630) 252-5381
http://www.linkedin.com/in/jeffhammond
https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond
ALCF docs: http://www.alcf.anl.gov/user-guides



More information about the discuss mailing list