Skip to content

Simplify workflow for Github CI#3194

Merged
oskooi merged 10 commits intoNanoComp:masterfrom
oskooi:github_ci_fixes
Apr 8, 2026
Merged

Simplify workflow for Github CI#3194
oskooi merged 10 commits intoNanoComp:masterfrom
oskooi:github_ci_fixes

Conversation

@oskooi
Copy link
Copy Markdown
Collaborator

@oskooi oskooi commented Apr 4, 2026

CI Workflow Improvements: Reducing Test Matrix Redundancies

The current CI matrix runs 4 jobs (2 Python versions $\times$ 2 MPI modes):

Job Python MPI Configure flags
1 3.9 no --with-openmp
2 3.9 yes --with-openmp
3 3.11 no --with-openmp
4 3.11 yes --enable-single --enable-swig-python-threads

Each job does make distcheck, which is expensive: it creates a tarball, extracts it, configures, builds, and runs the full test suite from scratch.

Key Finding: The Python version axis adds no value

After examining all 66 Python test files and both Makefiles:

  • Zero tests have Python-version-specific conditionals or behaviors
  • The test suite is identical regardless of Python 3.9 vs 3.11
  • The C++ library being tested is the same binary in both cases
  • The only meaningful test axes are (1) serial vs MPI and (2) double vs single precision

Running the full test suite twice per MPI mode (once per Python version) is pure redundancy.

Recommended changes

1 Reduce matrix from 4 jobs to 3 by dropping duplicate Python-version testing

Replace the 2 $\times$ 2 matrix with explicit include entries:

Job Python MPI Configure flags Purpose
1 3.11 no --with-openmp Serial + double-precision
2 3.11 yes --with-openmp MPI + double-precision
3 3.11 yes --enable single --enable-swig-python-threads MPI + single-precision

This preserves full coverage of the three meaningful configurations (serial, MPI, single-precision) while eliminating the redundant Python 3.9 runs. If minimum Python-version compatibility is important, one job could use 3.9 instead, but it shouldn't duplicate a configuration already tested with 3.11.

2 Cache dependency builds

libctl, harminv, MPB, and libGDSII are built from source on every run but change very rarely. Adding a cache step would save ~5-10 minutes per job.

All four dependencies (libctl, harminv, MPB, libGDSII) would be covered by a single cache key since they are all installed to ~/local. The cache would only rebuild when the workflow file changes.

3 Use make check instead of make distcheck for most jobs

make distcheck (creates tarball, extracts, reconfigures, rebuilds, tests) is much more expensive than make check (just runs tests against the already-built code). Only one job needs to verify the distribution tarball works. The other jobs can use make check to save significant time.

Suggested: Run distcheck on Job 1 (serial) only, use make check on Jobs 2-3.

@oskooi oskooi added the github_actions Pull requests that update GitHub Actions code label Apr 4, 2026
@oskooi oskooi force-pushed the github_ci_fixes branch from 7847d8b to 3c64250 Compare April 6, 2026 04:19
@oskooi
Copy link
Copy Markdown
Collaborator Author

oskooi commented Apr 8, 2026

The "serial double-precision" matrix build which involves OpenMP (--with-openmp) and tested using make distcheck is producing several failing tests. These test failures are due to slight changes in floating-point arithmetic (attributed to the #pragma omp parallel compiler directives) which can be fixed by loosening some of the check tolerances.

These test failures have not been previously detected because the OpenMP build has actually never been tested as part of the CI workflow using GitHub Actions. This is because the make distcheck command in the existing workflow is missing the --with-openmp flag passed to DISTCHECK_CONFIGURE_FLAGS:

- name: Run make distcheck
run: |
pushd build &&
make ${MKCHECKFLAGS} distcheck DISTCHECK_CONFIGURE_FLAGS="--with-libctl=${HOME}/local/share/libctl ${MPICONF}" &&
popd

In order to get the tests to pass for the time being, the --with-openmp flag has been omitted from DISTCHECK_CONFIGURE_FLAGS. A PR separate can add OpenMP to the CI and include the necessary changes to the test tolerances. The objective of this PR is to simplify the CI.

@oskooi oskooi merged commit 82c13e2 into NanoComp:master Apr 8, 2026
4 checks passed
@oskooi oskooi deleted the github_ci_fixes branch April 8, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant