In the previous post I illustrated how to start MPI programs using the MPI command mpiexec
. mpiexec
provisions to each application instance an execution environment which enables effective communication between all instances.
MPI allows to organize application instances in groups and to create communication objects for communication between members of the same groups (intra-group communicator) or for communication between different groups (inter-group communicator). Per default mpiexec
creates the intra-group communicator MPI_COMM_WORLD
which enables communication between all application instances.
In this post I explain at the example of simple shell scripts how to determine the number of all application instances and how to differentiate applications instances via its rank. See my HPC Lab for more MPI examples.