User`s guide
Intel® MPI Library User’s Guide for Linux* OS
12
#PBS -l walltime=1:30:00
#PBS -q workq
#PBS -V
# Set Intel MPI environment
mpi_dir=<installdir>/<arch>/bin
cd $PBS_O_WORKDIR
source $mpi_dir/mpivars.sh
# Launch application
mpirun -n <# of processes> ./myprog
2. Submit the job using the PBS qsub command:
$ qsub pbs_run.sh
When using mpirun under a job scheduler, you do not need to determine the number of available
nodes. Intel MPI Library automatically detects the available nodes through the Hydra process
manager.
2.8. Controlling MPI Process Placement
The mpirun command controls how the ranks of the processes are allocated to the nodes
of the cluster. By default, the mpirun command uses group round-robin assignment,
putting consecutive MPI process on all processor ranks of a node. This placement
algorithm may not be the best choice for your application, particularly for clusters with
symmetric multi-processor (SMP) nodes.
Suppose that the geometry is <#ranks> = 4 and <#nodes> = 2, where adjacent pairs of
ranks are assigned to each node (for example, for two-way SMP nodes). To see the
cluster nodes, enter the command:
cat ~/mpi_hosts
The results should look as follows:
clusternode1
clusternode2
To equally distribute four processes of the application on two-way SMP clusters, enter the
following command:
mpirun –perhost 2 –n 4 ./myprog.exe
The output for the myprog.exe executable file may look as follows:
Hello world: rank 0 of 4 running on clusternode1