diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29f0233..d81858f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,7 @@ jobs: mpi: - mpich - openmpi + - intelmpi - msmpi os: - ubuntu-22.04 @@ -32,18 +33,26 @@ jobs: mpi: msmpi - os: ubuntu-20.04 mpi: msmpi + - os: macos-12 + mpi: intelmpi - os: macos-12 mpi: msmpi + - os: macos-11 + mpi: intelmpi - os: macos-11 mpi: msmpi - os: windows-2022 mpi: mpich - os: windows-2022 mpi: openmpi + - os: windows-2022 + mpi: intelmpi - os: windows-2019 mpi: mpich - os: windows-2019 mpi: openmpi + - os: windows-2019 + mpi: intelmpi steps: @@ -67,6 +76,10 @@ jobs: run: ompi_info if: ${{ matrix.mpi == 'openmpi' }} + - name: Show MPI info + run: impi_info + if: ${{ matrix.mpi == 'intelmpi' }} + - name: Show MPI info run: | Write-Host MSMPI_BIN=$Env:MSMPI_BIN @@ -75,14 +88,23 @@ jobs: Write-Host MSMPI_LIB64=$Env:MSMPI_LIB64 if: ${{ matrix.mpi == 'msmpi' }} - - name: Show MPI compilers + - name: Show MPI C compiler wrapper run: | command -v mpicc mpicc -show + if: ${{ runner.os != 'Windows' }} + + - name: Show MPI C++ compiler wrapper + run: | command -v mpicxx mpicxx -show - command -v mpifort - mpifort -show + if: ${{ runner.os != 'Windows' }} + + - name: Show MPI Fortran compiler wrapper + run: | + mpifort=$(command -v mpifort || command -v mpifc) + command -v $mpifort + $mpifort -show if: ${{ runner.os != 'Windows' }} - name: Help MPI executor diff --git a/README.md b/README.md index e23e650..423ae66 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - mpi: [ 'mpich', 'openmpi' ] + mpi: [ 'mpich', 'openmpi', 'intelmpi'] name: ${{ matrix.mpi }} example steps: - name: Checkout @@ -39,6 +39,14 @@ jobs: # Available MPI implementations -* Linux: [MPICH](https://www.mpich.org/) and [Open MPI](https://www.open-mpi.org/) (`apt` install). -* macOS: [MPICH](https://www.mpich.org/) and [Open MPI](https://www.open-mpi.org/) (`brew` install). -* Windows: [Microsoft MPI](https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi). +* Linux: + [MPICH](https://www.mpich.org/), + [Open MPI](https://www.open-mpi.org/), and + [Intel MPI](https://software.intel.com/intel-mpi-library) (`apt` install). + +* macOS: + [MPICH](https://www.mpich.org/) and + [Open MPI](https://www.open-mpi.org/) (`brew` install). + +* Windows: + [Microsoft MPI](https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi). diff --git a/setup-mpi.sh b/setup-mpi.sh index d5b7c5a..b94a6a9 100755 --- a/setup-mpi.sh +++ b/setup-mpi.sh @@ -3,6 +3,31 @@ set -eu MPI=$(echo "${1:-}" | tr '[:upper:]' '[:lower:]') +setup-apt-intel-oneapi () { + apt_repo_url=https://apt.repos.intel.com/ + gpg_key_url=$apt_repo_url/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB + keyring=/usr/share/keyrings/oneapi-archive-keyring.gpg + # download the key to system keyring + curl -s $gpg_key_url | gpg --dearmor | sudo tee $keyring > /dev/null + # add signed entry to apt sources + echo "deb [signed-by=${keyring}] ${apt_repo_url}/oneapi all main" | \ + sudo tee /etc/apt/sources.list.d/oneAPI.list + # update list of available packages + sudo apt update +} + +setup-env-intel-oneapi () { + set +u + source /opt/intel/oneapi/setvars.sh + set -u + echo "${I_MPI_ROOT}/bin" >> $GITHUB_PATH + echo "ONEAPI_ROOT=${ONEAPI_ROOT}" >> $GITHUB_ENV + echo "I_MPI_ROOT=${I_MPI_ROOT}" >> $GITHUB_ENV + echo "FI_PROVIDER_PATH=${FI_PROVIDER_PATH}" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV + echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> $GITHUB_ENV +} + case $(uname) in Linux) @@ -16,6 +41,11 @@ case $(uname) in openmpi) sudo apt install -y -q openmpi-bin libopenmpi-dev ;; + intelmpi) + setup-apt-intel-oneapi + sudo apt install -y -q intel-oneapi-mpi-devel + setup-env-intel-oneapi + ;; *) echo "Unknown MPI implementation:" $MPI exit 1 @@ -77,6 +107,11 @@ case $MPI in ompi_info --all echo "::endgroup::" ;; + intelmpi) + echo "::group::Run impi_info -all" + impi_info -all + echo "::endgroup::" + ;; esac if [ $MPI == openmpi ]; then