Skip to content

Commit 06c457b

Browse files
committed
Collect all MPI builds intto a single parallel job
1 parent d20805c commit 06c457b

File tree

1 file changed

+39
-72
lines changed

1 file changed

+39
-72
lines changed

.github/workflows/single-platform.yml

Lines changed: 39 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -7,90 +7,57 @@ on:
77
branches: [ "main", "dane_dev" ]
88

99
jobs:
10-
# build_GCC_MPI:
11-
# runs-on: ubuntu-latest
12-
13-
# steps:
14-
# - uses: actions/checkout@v4
15-
16-
# - name: Set up Spack
17-
# uses: spack/setup-spack@v2
18-
# with:
19-
# ref: develop # Spack version (examples: develop, releases/v0.23)
20-
# buildcache: true # Configure oci://ghcr.io/spack/github-actions-buildcache
21-
# color: true # Force color output (SPACK_COLOR=always)
22-
# path: spack # Where to clone Spack
23-
24-
# - name: Install OpenMPI
25-
# run: |
26-
# spack install -j 4 openmpi
27-
28-
# - name: Configure and Make GCC_MPI
29-
# run: |
30-
# . ./spack/share/spack/setup-env.sh # setup spack shell env
31-
# eval "$(spack load --sh openmpi)" # load into current shell
32-
# sed -E -i \
33-
# -e 's/^(ENABLE_MPI[[:space:]]*\?=[[:space:]]*).*/\1true/' \
34-
# -e 's/^(ENABLE_OPENMP[[:space:]]*\?=[[:space:]]*).*/\1false/' \
35-
# -e 's/^(TOOLCHAIN[[:space:]]*\?=[[:space:]]*).*/\1GCC/' config.mk
36-
# make
37-
38-
# build_ICC_MPI:
39-
# runs-on: ubuntu-latest
40-
41-
# steps:
42-
# - uses: actions/checkout@v4
43-
44-
# - name: Set up Spack
45-
# uses: spack/setup-spack@v2
46-
# with:
47-
# ref: develop # Spack version (examples: develop, releases/v0.23)
48-
# buildcache: true # Configure oci://ghcr.io/spack/github-actions-buildcache
49-
# color: true # Force color output (SPACK_COLOR=always)
50-
# path: spack # Where to clone Spack
51-
52-
# - name: Install Intel compiler/MPI
53-
# run: |
54-
# spack install -j 4 intel-oneapi-compilers
55-
# spack install -j 4 intel-oneapi-mpi
56-
57-
# - name: Configure and Make ICC_MPI
58-
# run: |
59-
# . ./spack/share/spack/setup-env.sh
60-
# eval "$(spack load --sh intel-oneapi-compilers)"
61-
# eval "$(spack load --sh intel-oneapi-mpi)"
62-
# sed -E -i \
63-
# -e 's/^(ENABLE_MPI[[:space:]]*\?=[[:space:]]*).*/\1true/' \
64-
# -e 's/^(ENABLE_OPENMP[[:space:]]*\?=[[:space:]]*).*/\1false/' \
65-
# -e 's/^(TOOLCHAIN[[:space:]]*\?=[[:space:]]*).*/\1ICC/' config.mk
66-
# make
67-
68-
build_CLANG_MPI:
10+
build:
6911
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
compiler: [GCC, ICC, CLANG]
7015

7116
steps:
7217
- uses: actions/checkout@v4
7318

7419
- name: Set up Spack
7520
uses: spack/setup-spack@v2
7621
with:
77-
ref: develop # Spack version (examples: develop, releases/v0.23)
78-
buildcache: true # Configure oci://ghcr.io/spack/github-actions-buildcache
79-
color: true # Force color output (SPACK_COLOR=always)
80-
path: spack # Where to clone Spack
22+
ref: develop
23+
buildcache: true
24+
color: true
25+
path: spack
8126

82-
- name: Install Clang compiler and OpenMPI
27+
- name: Install Compiler and MPI
8328
run: |
84-
spack install -j 4 llvm
85-
spack install -j 4 openmpi
29+
. ./spack/share/spack/setup-env.sh
8630
87-
- name: Configure and Make CLANG_MPI
31+
if [[ "${{ matrix.compiler }}" == "GCC" ]]; then
32+
spack install -j 4 openmpi
33+
elif [[ "${{ matrix.compiler }}" == "ICC" ]]; then
34+
spack install -j 4 intel-oneapi-compilers
35+
spack install -j 4 intel-oneapi-mpi
36+
elif [[ "${{ matrix.compiler }}" == "CLANG" ]]; then
37+
spack install -j 4 llvm
38+
spack install -j 4 openmpi
39+
fi
40+
41+
- name: Configure and Make
8842
run: |
8943
. ./spack/share/spack/setup-env.sh
90-
eval "$(spack load --sh llvm)"
91-
eval "$(spack load --sh openmpi)"
44+
45+
if [[ "${{ matrix.compiler }}" == "GCC" ]]; then
46+
eval "$(spack load --sh openmpi)"
47+
elif [[ "${{ matrix.compiler }}" == "ICC" ]]; then
48+
eval "$(spack load --sh intel-oneapi-compilers)"
49+
eval "$(spack load --sh intel-oneapi-mpi)"
50+
elif [[ "${{ matrix.compiler }}" == "CLANG" ]]; then
51+
eval "$(spack load --sh llvm)"
52+
eval "$(spack load --sh openmpi)"
53+
fi
54+
55+
TOOLCHAIN="${{ matrix.compiler }}"
56+
9257
sed -E -i \
93-
-e 's/^(ENABLE_MPI[[:space:]]*\?=[[:space:]]*).*/\1true/' \
94-
-e 's/^(ENABLE_OPENMP[[:space:]]*\?=[[:space:]]*).*/\1false/' \
95-
-e 's/^(TOOLCHAIN[[:space:]]*\?=[[:space:]]*).*/\1CLANG/' config.mk
58+
-e 's/^(ENABLE_MPI[[:space:]]*\?=[[:space:]]*).*/\1true/' \
59+
-e 's/^(ENABLE_OPENMP[[:space:]]*\?=[[:space:]]*).*/\1false/' \
60+
-e "s/^(TOOLCHAIN[[:space:]]*\?=[[:space:]]*).*/\1${TOOLCHAIN}/" \
61+
config.mk
62+
9663
make

0 commit comments

Comments
 (0)