Skip to content

Commit

Permalink
Enable MPI tests
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <[email protected]>
  • Loading branch information
LecrisUT committed Aug 25, 2023
1 parent 1528726 commit c289a67
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
30 changes: 24 additions & 6 deletions .github/workflows/step_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: pre-commit/[email protected]

tests:
name: Check on ${{ matrix.toolchain }} toolchain
name: Check on ${{ matrix.toolchain }} toolchain ${{ matrix.mpi }}
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
container: ${{ !matrix.os && 'ghcr.io/lecrisut/dev-env:main' || '' }}
needs: [ pre-commit ]
Expand All @@ -30,23 +30,41 @@ jobs:
fail-fast: false
matrix:
toolchain: [ gcc, llvm, intel ]
mpi: ['', openmpi, mpich, intel]
include:
# flang is missing features in 16.0.6
- toolchain: llvm
experimental: true
steps:
- name: Install missing packages
run: dnf install -y bzip2 python-unversioned-command
- name: Load mpi module ${{ matrix.mpi }}
run: |
# Get interactive profile to be able to load modules
source /etc/profile
# Save the current environment since we only want the added difference
printenv > orig_env
# Load the relevant mpi module
module load mpi/${{ matrix.mpi }}
printenv > module_env
diff orig_env module_env | sed -n 's/> //p' >> $GITHUB_ENV
# Set MPI flag on
echo "WITH_MPI=ON" >> $GITHUB_ENV
if: ${{ matrix.mpi }}
- name: Enable msvc toolchain on windows
uses: ilammy/msvc-dev-cmd@v1
if: contains(matrix.os, 'windows')
- name: Activate Intel compilers
# Not elegant, it will propagate all environment variable.
# Intel does not provide a way to output the environment variables to a file
# Note: PATH needs to be exported to GITHUB_PATH otherwise it can be overwritten
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
source /etc/profile
printenv > orig_env
module load compiler
printenv > module_env
diff orig_env module_env | sed -n 's/> //p' >> $GITHUB_ENV
echo $PATH >> $GITHUB_PATH
if: matrix.toolchain == 'intel'
- uses: actions/checkout@v3
Expand Down
4 changes: 4 additions & 0 deletions cmake/CMakePresets-CI.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"WANNIER90_TEST": {
"type": "BOOL",
"value": true
},
"WANNIER90_WITH_MPI": {
"type": "BOOL",
"value": "$env{WITH_MPI}"
}
},
"errors": {
Expand Down

0 comments on commit c289a67

Please sign in to comment.