Skip to content

Commit 54af02f

Browse files
committed
Add support for Intel MPI
1 parent 575215e commit 54af02f

File tree

3 files changed

+72
-7
lines changed

3 files changed

+72
-7
lines changed

.github/workflows/ci.yml

+25-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
mpi:
2020
- mpich
2121
- openmpi
22+
- intelmpi
2223
- msmpi
2324
os:
2425
- ubuntu-22.04
@@ -32,18 +33,26 @@ jobs:
3233
mpi: msmpi
3334
- os: ubuntu-20.04
3435
mpi: msmpi
36+
- os: macos-12
37+
mpi: intelmpi
3538
- os: macos-12
3639
mpi: msmpi
40+
- os: macos-11
41+
mpi: intelmpi
3742
- os: macos-11
3843
mpi: msmpi
3944
- os: windows-2022
4045
mpi: mpich
4146
- os: windows-2022
4247
mpi: openmpi
48+
- os: windows-2022
49+
mpi: intelmpi
4350
- os: windows-2019
4451
mpi: mpich
4552
- os: windows-2019
4653
mpi: openmpi
54+
- os: windows-2019
55+
mpi: intelmpi
4756

4857
steps:
4958

@@ -67,6 +76,10 @@ jobs:
6776
run: ompi_info
6877
if: ${{ matrix.mpi == 'openmpi' }}
6978

79+
- name: Show MPI info
80+
run: impi_info
81+
if: ${{ matrix.mpi == 'intelmpi' }}
82+
7083
- name: Show MPI info
7184
run: |
7285
Write-Host MSMPI_BIN=$Env:MSMPI_BIN
@@ -75,14 +88,23 @@ jobs:
7588
Write-Host MSMPI_LIB64=$Env:MSMPI_LIB64
7689
if: ${{ matrix.mpi == 'msmpi' }}
7790

78-
- name: Show MPI compilers
91+
- name: Show MPI C compiler wrapper
7992
run: |
8093
command -v mpicc
8194
mpicc -show
95+
if: ${{ runner.os != 'Windows' }}
96+
97+
- name: Show MPI C++ compiler wrapper
98+
run: |
8299
command -v mpicxx
83100
mpicxx -show
84-
command -v mpifort
85-
mpifort -show
101+
if: ${{ runner.os != 'Windows' }}
102+
103+
- name: Show MPI Fortran compiler wrapper
104+
run: |
105+
mpifort=$(command -v mpifort || command -v mpifc)
106+
command -v $mpifort
107+
$mpifort -show
86108
if: ${{ runner.os != 'Windows' }}
87109

88110
- name: Help MPI executor

README.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
strategy:
2626
matrix:
27-
mpi: [ 'mpich', 'openmpi' ]
27+
mpi: [ 'mpich', 'openmpi', 'intelmpi']
2828
name: ${{ matrix.mpi }} example
2929
steps:
3030
- name: Checkout
@@ -39,6 +39,14 @@ jobs:
3939
4040
# Available MPI implementations
4141
42-
* Linux: [MPICH](https://www.mpich.org/) and [Open MPI](https://www.open-mpi.org/) (`apt` install).
43-
* macOS: [MPICH](https://www.mpich.org/) and [Open MPI](https://www.open-mpi.org/) (`brew` install).
44-
* Windows: [Microsoft MPI](https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi).
42+
* Linux:
43+
[MPICH](https://www.mpich.org/),
44+
[Open MPI](https://www.open-mpi.org/), and
45+
[Intel MPI](https://software.intel.com/intel-mpi-library) (`apt` install).
46+
47+
* macOS:
48+
[MPICH](https://www.mpich.org/) and
49+
[Open MPI](https://www.open-mpi.org/) (`brew` install).
50+
51+
* Windows:
52+
[Microsoft MPI](https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi).

setup-mpi.sh

+35
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@ set -eu
33

44
MPI=$(echo "${1:-}" | tr '[:upper:]' '[:lower:]')
55

6+
setup-apt-intel-oneapi () {
7+
apt_repo_url=https://apt.repos.intel.com/
8+
gpg_key_url=$apt_repo_url/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
9+
keyring=/usr/share/keyrings/oneapi-archive-keyring.gpg
10+
# download the key to system keyring
11+
curl -s $gpg_key_url | gpg --dearmor | sudo tee $keyring > /dev/null
12+
# add signed entry to apt sources
13+
echo "deb [signed-by=${keyring}] ${apt_repo_url}/oneapi all main" | \
14+
sudo tee /etc/apt/sources.list.d/oneAPI.list
15+
# update list of available packages
16+
sudo apt update
17+
}
18+
19+
setup-env-intel-oneapi () {
20+
set +u
21+
source /opt/intel/oneapi/setvars.sh
22+
set -u
23+
echo "${I_MPI_ROOT}/bin" >> $GITHUB_PATH
24+
echo "ONEAPI_ROOT=${ONEAPI_ROOT}" >> $GITHUB_ENV
25+
echo "I_MPI_ROOT=${I_MPI_ROOT}" >> $GITHUB_ENV
26+
echo "FI_PROVIDER_PATH=${FI_PROVIDER_PATH}" >> $GITHUB_ENV
27+
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
28+
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> $GITHUB_ENV
29+
}
30+
631
case $(uname) in
732

833
Linux)
@@ -16,6 +41,11 @@ case $(uname) in
1641
openmpi)
1742
sudo apt install -y -q openmpi-bin libopenmpi-dev
1843
;;
44+
intelmpi)
45+
setup-apt-intel-oneapi
46+
sudo apt install -y -q intel-oneapi-mpi-devel
47+
setup-env-intel-oneapi
48+
;;
1949
*)
2050
echo "Unknown MPI implementation:" $MPI
2151
exit 1
@@ -77,6 +107,11 @@ case $MPI in
77107
ompi_info --all
78108
echo "::endgroup::"
79109
;;
110+
intelmpi)
111+
echo "::group::Run impi_info -all"
112+
impi_info -all
113+
echo "::endgroup::"
114+
;;
80115
esac
81116

82117
if [ $MPI == openmpi ]; then

0 commit comments

Comments
 (0)