-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tidy up the Makefile and add utility testing script
- Loading branch information
1 parent
bda45e2
commit e077d21
Showing
9 changed files
with
90 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ jobs: | |
OPENBLAS_NUM_THREADS: 1 | ||
COMPLEX: ${{ matrix.complex }} | ||
RDMAV_FORK_SAFE: 1 | ||
EXTRA_PYTEST_ARGS: --splitting-algorithm least_duration --timeout=1800 --timeout-method=thread -o faulthandler_timeout=1860 | ||
outputs: | ||
scalar-type: ${{ matrix.scalar-type }} | ||
steps: | ||
|
@@ -101,73 +102,46 @@ jobs: | |
- name: Run tests (nprocs = 1) | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
: # use --quote to stop parallel from parsing the pytest arguments | ||
parallel --line-buffer --tag --quote \ | ||
pytest -v --splits 12 --group {#} --splitting-algorithm least_duration \ | ||
--timeout=1800 --timeout-method=thread -o faulthandler_timeout=1860 \ | ||
--junit-xml=firedrake1_{#}.xml \ | ||
-m "parallel[1] or not parallel" tests/firedrake ::: $(seq 12) | ||
firedrake-run-split-tests tests/firedrake 1 12 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake1_{#}.xml" | ||
- name: Run tests (nprocs = 2) | ||
# Run even if earlier tests failed | ||
if: ${{ success() || steps.build.conclusion == 'success' }} | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
parallel --line-buffer --tag --quote \ | ||
mpiexec -n 2 pytest -v --splits 6 --group {#} --splitting-algorithm least_duration \ | ||
--timeout=1800 --timeout-method=thread -o faulthandler_timeout=1860 \ | ||
--junit-xml=firedrake2_{#}.xml \ | ||
-m parallel[2] tests/firedrake ::: $(seq 6) | ||
firedrake-run-split-tests tests/firedrake 2 6 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake2_{#}.xml" | ||
- name: Run tests (nprocs = 3) | ||
if: ${{ success() || steps.build.conclusion == 'success' }} | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
parallel --line-buffer --tag --quote \ | ||
mpiexec -n 3 pytest -v --splits 4 --group {#} --splitting-algorithm least_duration \ | ||
--timeout=1800 --timeout-method=thread -o faulthandler_timeout=1860 \ | ||
--junit-xml=firedrake3_{#}.xml \ | ||
-m parallel[3] tests/firedrake ::: $(seq 4) | ||
firedrake-run-split-tests tests/firedrake 3 4 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake3_{#}.xml" | ||
- name: Run tests (nprocs = 4) | ||
if: ${{ success() || steps.build.conclusion == 'success' }} | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
parallel --line-buffer --tag --quote \ | ||
mpiexec -n 4 pytest -v --splits 3 --group {#} --splitting-algorithm least_duration \ | ||
--timeout=1800 --timeout-method=thread -o faulthandler_timeout=1860 \ | ||
--junit-xml=firedrake4_{#}.xml \ | ||
-m parallel[4] tests/firedrake ::: $(seq 3) | ||
firedrake-run-split-tests tests/firedrake 4 3 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake4_{#}.xml" | ||
# NOTE: We do not have any tests that run with 5 processes | ||
|
||
- name: Run tests (nprocs = 6) | ||
if: ${{ success() || steps.build.conclusion == 'success' }} | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
parallel --line-buffer --tag --quote \ | ||
mpiexec -n 6 pytest -v --splits 2 --group {#} --splitting-algorithm least_duration \ | ||
--timeout=1800 --timeout-method=thread -o faulthandler_timeout=1860 \ | ||
--junit-xml=firedrake6_{#}.xml \ | ||
-m parallel[6] tests/firedrake ::: $(seq 2) | ||
firedrake-run-split-tests tests/firedrake 6 2 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake6_{#}.xml" | ||
- name: Run tests (nprocs = 7) | ||
if: ${{ success() || steps.build.conclusion == 'success' }} | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
mpiexec -n 7 pytest -v \ | ||
--timeout=1800 --timeout-method=thread -o faulthandler_timeout=1860 \ | ||
--junit-xml=firedrake7.xml \ | ||
-m parallel[7] tests/firedrake | ||
firedrake-run-split-tests tests/firedrake 7 1 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake7_{#}.xml" | ||
- name: Run tests (nprocs = 8) | ||
if: ${{ success() || steps.build.conclusion == 'success' }} | ||
run: | | ||
. ../firedrake_venv/bin/activate | ||
mpiexec -n 8 pytest -v \ | ||
--timeout=1800 --timeout-method=thread -o faulthandler_timeout=1860 \ | ||
--junit-xml=firedrake8.xml \ | ||
-m parallel[8] tests/firedrake | ||
firedrake-run-split-tests tests/firedrake 8 1 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake8_{#}.xml" | ||
- name: Publish Test Report | ||
uses: mikepenz/[email protected] | ||
|
@@ -179,6 +153,13 @@ jobs: | |
updateComment: true | ||
flaky_summary: true | ||
|
||
- name: Upload log files | ||
uses: actions/upload-artifact@v4 | ||
# if: failure(), for debugging | ||
with: | ||
name: firedrake-logs-${{ matrix.scalar-type }} | ||
path: pytest_*.log | ||
|
||
- name: Test pyadjoint | ||
if: ${{ matrix.scalar-type == 'real' }} | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
# TODO: Write a docstring for this | ||
|
||
|
||
tests=$1 | ||
num_procs=$2 | ||
num_jobs=$3 | ||
extra_args=${@:4} | ||
|
||
log_file_prefix="pytest_nprocs${num_procs}_job" | ||
|
||
if [ $num_procs = 1 ]; then | ||
pytest_exec="python -m pytest" | ||
marker_spec="\"parallel[1] or not parallel\"" | ||
else | ||
pytest_exec="mpiexec -n ${num_procs} python -m pytest" | ||
marker_spec="parallel[${num_procs}]" | ||
fi | ||
|
||
pytest_cmd="${pytest_exec} -v \ | ||
--splits ${num_jobs} --group {#} \ | ||
-m ${marker_spec} ${extra_args} ${tests}" | ||
|
||
insn="parallel --line-buffer --tag \ | ||
${pytest_cmd} |& tee ${log_file_prefix}{#}.log; \ | ||
echo \${PIPESTATUS[0]} > job{#}.errcode \ | ||
::: $(seq ${num_jobs})" | ||
|
||
echo Running: ${insn} | ||
${insn} | ||
|
||
for i in $(seq 1 ${num_jobs}); do | ||
error_code=$(cat job${i}.errcode) | ||
if [ ${error_code} = "0" ]; then | ||
echo Job ${i} passed | ||
else | ||
echo Job ${i} failed, inspect the logs in ${log_file_prefix}${i}.log | ||
fi | ||
done | ||
|
||
echo Cleaning up | ||
for i in $(seq 1 ${num_jobs}); do | ||
rm job${i}.errcode | ||
done | ||
echo Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters