OpenMPI
What is OpenMPI?
OpenMPI is one of the MPI libraries installed to various RC machines with wrapper compilers to Open SHMEM, which provides exceedingly quick one direction communication.
How is OpenMPI loaded?
The below can be used to view all of the installations of MPICH on a particular system, where this example uses Coeus.
$ module avail |& grep "^openmpi"
openmpi-1.6/gcc
openmpi-1.6/gcc-6.3.0
openmpi-1.6/gcc-7.2.0
openmpi-1.6/gcc-8.2.0
openmpi-1.6/gcc-9.2.0
openmpi-1.6/intel
openmpi-1.8/gcc
openmpi-1.8/gcc-6.3.0
openmpi-1.8/gcc-7.2.0
openmpi-1.8/gcc-8.2.0
openmpi-1.8/gcc-9.2.0
openmpi-1.8/intel
openmpi-2.0/gcc
openmpi-2.0/gcc-6.3.0
openmpi-2.0/gcc-7.2.0
openmpi-2.0/gcc-8.2.0
openmpi-2.0/intel
openmpi-2.1.3/gcc-9.2.0
openmpi-3.0.1/gcc-9.2.0
Which version should be used?
The RC systems may contain many different versions of this software. The reason behind keeping all the old versions is because some applications cannot or do not update to the most recent version, so the modules are kept for legacy support. In general, it is best to use the most recent major release, unless some software requires a different version.
How is something ran with OpenMPI?
It is recommended to use mpiexec to start an MPI program. The example on Coeus (below) will compile the program and then create four copies of the executable and run them all where they all can communicate using MPI.
$ module load openmpi-3.0.1/gcc-9.2.0
$ mpicc -o my_example my_example.c
$ mpiexec -n 4 my_example
How are OpenMPI compilers invoked?
To compile MPI programs, the program must be compiled using MPI libraries and with the MPI compiler (for more, refer to here).
Unless specifically needed, it is recommended to use compilers with prefix "mpi-".
MPI C
mpicc
oshcc
shmemcc
MPI C++
mpicxx
mpic++
mpiCC
oshcxx
oshc++
oshCC
shmemcxx
shmemc++
shmemCC
MPI Fortran
mpif77
mpif90
mpifort
oshfort
shmemfort