Skip to content

Commit 4332f3d

Browse files
fixup
1 parent 5b3c88f commit 4332f3d

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

.github/workflows/CI.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,25 @@ jobs:
135135
- name: Run tests
136136
run: |
137137
export PYTHONPATH="$PWD/build"
138-
mpirun -np 1 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests --ignore=tests/test_hmatrix.py --ignore=tests/test_logger.py
139-
mpirun -np 2 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests --ignore=tests/test_hmatrix.py --ignore=tests/test_logger.py
140-
mpirun -np 3 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests --ignore=tests/test_hmatrix.py --ignore=tests/test_logger.py
141-
mpirun -np 4 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests --ignore=tests/test_hmatrix.py --ignore=tests/test_logger.py
138+
export GCOV_PREFIX_STRIP=2
139+
COVDIR=/tmp/gcov-mpi
140+
mkdir -p $COVDIR
141+
142+
# Wrap mpirun calls so each rank writes to its own subdir
143+
run_mpi_pytest() {
144+
local np=$1
145+
shift
146+
mpirun -np $np ${{ matrix.MPIEXEC_PREFLAGS }} \
147+
bash -c 'export GCOV_PREFIX='"$COVDIR"'/${OMPI_COMM_WORLD_RANK}; \
148+
mkdir -p $GCOV_PREFIX; \
149+
python3 -m pytest "$@"' bash "$@"
150+
}
151+
152+
run_mpi_pytest 1 tests --ignore=tests/test_hmatrix.py --ignore=tests/test_logger.py
153+
run_mpi_pytest 2 tests --ignore=tests/test_hmatrix.py --ignore=tests/test_logger.py
154+
run_mpi_pytest 3 tests --ignore=tests/test_hmatrix.py --ignore=tests/test_logger.py
155+
run_mpi_pytest 4 tests --ignore=tests/test_hmatrix.py --ignore=tests/test_logger.py
156+
142157
python3 -m pytest tests/test_hmatrix.py
143158
python3 -m pytest tests/test_logger.py
144159

0 commit comments

Comments
 (0)