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

Kirill Lykov kirill.lykov at usi.ch
Mon Feb 25 10:06:51 CST 2013


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





More information about the discuss mailing list