Let's assume, I run my Open MPI application with the following command:
mpirun a.out
and I specify the number of MPI ranks by means of an LSF job scheduler script:
#BSUB -n 20
How to specify the number of MPI ranks for mpirun
through some Open MPI environment variable?
The reason for my need is the following. First, I need to allocate 20 cores on a node and run 5 independent parallel jobs (1, 2, 3, 4, 10 MPI ranks). Second, I do not have an opportunity to submit these jobs as non-exclusive jobs to the same host. Third, I do not directly invoke mpirun a.out
command, as it is hidden deeply inside some complex third-parth script run.sh
, and that is only the run.sh
script that I can explicitly execute in the job scheduler command file. That is why I would like to do something like this:
OMPI_NUM_RANKS=1 run.sh &
OMPI_NUM_RANKS=2 run.sh &
...
OMPI_NUM_RANKS=10 run.sh &