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

Pavan Balaji balaji at mcs.anl.gov
Mon Apr 29 21:12:24 CDT 2013


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



More information about the discuss mailing list