3.10. MPI Applications

From a RP perspective, units that execute MPI applications are analogous to non-MPI units: they define an executable alongside its arguments and other related parameters. MPI units have two main characteristics: (a) allocating a specified number of cores; and (b) needing to be started under an MPI regime. The respective unit description entries are shown below:

cud = rp.ComputeUnitDescription()

cud.executable  = '/bin/echo'
cud.arguments   = ['-n', '$RP_UNIT_ID ']
cud.cores       = 2
cud.mpi         = True

This example should result in the unit ID echo’ed twice, once per MPI rank.


Some RP configurations require MPI applications to be linked against a specific version of OpenMPI. Please open a ticket if you need support with relinking your application.

3.10.1. Running the Example

09_mpi_units.py. uses the code above to run a bag of duplicated echo commands:


3.10.2. What’s Next?

The next section describes how to insert arbitrary setup commands before and after .. the execution of a unit.