OpenMPI Library

Version Module file Name System A System B/C System G Cloud System Notes
4.1.5 openmpi/4.1.5_nvhpc-23.9 - - + - Introduced in April 2024
4.1.5 openmpi/4.1.5_nvhpc-23.5 - - + - Introduced in August 2023
4.0.5 openmpi/4.0.5_intel-2022.3 + + - + Introduced in June 2023
4.0.5 openmpi/4.0.5_gnu-8.5.0 + + + + Introduced in November 2022
4.0.5 openmpi/4.0.5_nvhpc-22.9 - - + - Introduced in November 2022
4.0.5 openmpi/4.0.5_nvhpc-22.5 - - + - Introduced in November 2022

+ : Available for all users
- : Not available

The thread parallel support level available in Open MPI is MPI_THREAD_MULTIPLE. MPI functions can be called from each thread with no restriction.

Compile commands

Language Command Operands
Fortran mpifort mpifort Option File Name
C mpicc mpicc Option File Name
C++ mpic++ mpic++ Option File Name

Examples of Compiling

$ mpifort -O3 sample_mpi.f90

To execute the compiled MPI program, use tssrun command for interactive processing and srun for batch processing. For both interactive processing and batch processing, the number of parallelism is specified by the --rsc option argument p. Please refer to sample for details.

Example (interactive processing)

$ tssrun --rsc p=2 ./a.out

Please refer to the Interactive Processing for details on the execution with interactive processing.

  • Execute in 8 parallels
$ tssrun --rsc p=8 ./a.out
  • Execute in combination with thread parallelism(MPI 4 parallel, OpenMP 8 parallel)
$ tssrun --rsc p=4:t=8:c=8 ./a.out

Please refer to the batch processing for details on the batch execution.

  • Execute in 8 parallels
$ cat sample.sh
#!/bin/bash
#============ SBATCH Directives =======
#SBATCH -p gr19999b
#SBATCH -t 1:0:0
#SBATCH --rsc p=8
#SBATCH -o %x.%A.out

#============ Shell Script ============
srun ./a.out
$ sbatch sample.sh
  • Execute in combination with thread parallelism(MPI 4 parallel, OpenMP 8 parallel)
$ cat sample.sh
#!/bin/bash
#============ SBATCH Directives =======
#SBATCH -p gr19999b
#SBATCH -t 1:0:0
#SBATCH --rsc p=4:t=8:c=8:m=8G
#SBATCH -o %x.%A.out

#============ Shell Script ============
srun  ./a.out
$ sbatch sample.sh