MPI
Install MPICH, Open MPI, Intel MPI or HPC-X for supported compiler and runner combinations. Use exported compiler wrappers and launcher settings with fpm, CMake or Meson.
Supported combinations
| Runner | compiler |
mpi |
|---|---|---|
| Ubuntu | gfortran |
mpich, openmpi |
| Ubuntu | ifx |
intelmpi |
| Ubuntu | nvfortran |
hpcx |
| macOS | gfortran |
mpich, openmpi |
| Windows | ifx |
intelmpi |
Inputs
| Input | Default | Value |
|---|---|---|
mpi |
none |
none, mpich,
openmpi, intelmpi,
hpcx
|
mpi-version |
empty |
Version, latest, or empty; requires
mpi
|
Permissions
MPI setup reads Actions job metadata and checks out the repository by default.
permissions:
actions: read
contents: read
Exported environment
MPIFC, MPIF90,
MPIF77, MPICC,
MPICXX, MPIEXEC,
MPIEXEC_NUMPROC_FLAG, MPI_HOME
fpm
fpm and the selected MPI toolchain are installed.
test_mpi_fpm:
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.mpi }}_fpm
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-latest, compiler: gfortran, compiler-version: "", mpi: openmpi, mpi-version: ""}
steps:
- name: setup-fortran-conda
uses: gha3mi/setup-fortran-conda@latest
with:
compiler: ${{ matrix.compiler }}
compiler-version: ${{ matrix.compiler-version }}
mpi: ${{ matrix.mpi }}
mpi-version: ${{ matrix.mpi-version }}
- name: fpm MPI test
run: fpm test --compiler "${{ env.MPIFC }}" --runner "${{ env.MPIEXEC }}" --runner-args=" ${{ env.MPIEXEC_NUMPROC_FLAG }} 2" --verbose
CMake
CMake, Ninja and the selected MPI
toolchain are installed.
test_mpi_cmake:
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.mpi }}_cmake
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-latest, compiler: gfortran, compiler-version: "", mpi: mpich, mpi-version: ""}
steps:
- name: setup-fortran-conda
uses: gha3mi/setup-fortran-conda@latest
with:
compiler: ${{ matrix.compiler }}
compiler-version: ${{ matrix.compiler-version }}
mpi: ${{ matrix.mpi }}
mpi-version: ${{ matrix.mpi-version }}
- name: CMake MPI test
run: |
cmake -S . -B build -G Ninja -DCMAKE_Fortran_COMPILER="${{ env.MPIFC }}" -DMPIEXEC_EXECUTABLE="${{ env.MPIEXEC }}"
cmake --build build --verbose
ctest --test-dir build --output-on-failure -VV
Meson
Meson, Ninja and the selected MPI
toolchain are installed.
test_mpi_meson:
name: ${{ matrix.os }}_${{ matrix.compiler }}_${{ matrix.mpi }}_meson
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {os: ubuntu-latest, compiler: gfortran, compiler-version: "", mpi: openmpi, mpi-version: ""}
steps:
- name: setup-fortran-conda
uses: gha3mi/setup-fortran-conda@latest
with:
compiler: ${{ matrix.compiler }}
compiler-version: ${{ matrix.compiler-version }}
mpi: ${{ matrix.mpi }}
mpi-version: ${{ matrix.mpi-version }}
- name: Meson MPI test
run: |
meson setup build --buildtype release --backend=ninja -Dfortran_args=-DUSE_MPI
meson compile -C build --verbose
meson test -C build --verbose