Repository navigation
Regtests for the coverage of src/mpiwrap and src/main - #1735
Merged
Merged
Conversation
- basic/rt-mpiwrap-launcher-host (2 MPI processes, native-MPI builds only): mpiwrap::launchRanks with a host-owned MPI (successful launch, rank-count mismatch, callback exception rethrown to the host), the argument and lifecycle errors before MPI_Init and after MPI_Finalize, a rank-count mismatch with a launcher-owned MPI (MPI initialized and finalized again before the exception) and a callback exception with a launcher-owned MPI (the job is aborted). - basic/rt-plumed-runtime-kernel: the plumed-runtime executable (main.cpp with the kernel loaded at runtime) with a working kernel, and with a PLUMED_KERNEL that cannot be loaded (exit code 1, no crash). Lines covered in the -coverage-mpi- build: mpiwrap/launcher.cpp 26/50 -> 42/50, main/main.cpp 25/35 -> 28/35. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016vwxtV38tUZEERzzsopLk4
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1735 +/- ##
==========================================
- Coverage 92.08% 91.93% -0.15%
==========================================
Files 655 661 +6
Lines 82410 86382 +3972
==========================================
+ Hits 75884 79417 +3533
- Misses 6526 6965 +439 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Most of src/mpiwrap (mpiwrap.cpp, loader.cpp, fallbacks.cpp, tmpi.cpp) is compiled only in serial builds, so the -coverage-mpi- job cannot measure it. The serial-mpi-injection job now instruments only src/mpiwrap (a Makefile.conf snippet adds --coverage when compiling there, LDFLAGS=--coverage links the gcov runtime), runs the MPI regtests of basic/ again with internal thread-MPI after the suite through the MPI host and the focused checks, and uploads the lcov report of src/mpiwrap to Codecov (merged with the -coverage-mpi- one) and as an HTML artifact. --coverage is kept out of LDSHARED: the providers that mkmpi builds at runtime reuse those flags, and an instrumented provider leaves a .gcda file in its temporary build directory, which check-mpi-provider-selection.sh reports. Measured in a cloud replica of the job (basic/ MPI regtests through the host and with thread-MPI, then the focused checks): src/mpiwrap 2451/4112 lines (59.6%); loader.cpp goes from 16% to 70% with the focused checks. The extra steps take about 4 minutes on 2 cores. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016vwxtV38tUZEERzzsopLk4
… constants In a serial build rt-mpiwrap-api runs its body on the embedded thread-MPI provider only, so the 62 mapped functions and the predefined values that thread-MPI lacks were never dispatched through the kernel's provider bridges. - check-mpi-api-provider.sh compiles the body of main.cpp with the installed kernel's serial frontend (PLUMED_MPIW_API_REGTEST_LIBRARY), links it into an MPI program that owns MPI_Init/MPI_Finalize, and runs it on 4 processes with a real-MPI provider selected through PLUMED_MPI_WRAPPER. Run by the serial-mpi-injection job with the Open MPI provider built by mkmpi. - The body takes a Context: the thread-MPI capability contract is checked only on the thread-MPI provider (and provider_ranks_are_threads() must agree). - New constants() scenario, run with native MPI and with a real-MPI provider: reductions with every basic datatype, MAXLOC/MINLOC with the value-index pair types, PROD/MAX/MIN and the logical and bitwise operations, MPI_PACKED, MPI_BOTTOM, MPI_COMM_WORLD, MPI_SIMILAR/MPI_UNEQUAL, MPI_GROUP_EMPTY, MPI_ERRORS_RETURN/ARE_FATAL, MPI_ERRHANDLER_NULL and the error classes. Checked: rt-mpiwrap-api passes in a native Open MPI build (constants() included) and in a serial build (thread-MPI); the new script passes with the Open MPI provider. src/mpiwrap serial coverage in a replica of the CI job: mpiwrap.cpp 56% -> 92%, src/mpiwrap 59.6% -> 87.6% of lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016vwxtV38tUZEERzzsopLk4
Member
Author
|
@GiovanniBussi #1729 this add serial coverage |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
src/mpiwrap and src/main coverage (2026-12-02)
Branch status
mpiwrap-main-coveragein Carlo's ~/Codes/plumed2, one commit 531903f on master 73a8726, fetched fromClaude outputs/mpiwrap-main-coverage/mpiwrap-main-coverage.bundle. Not pushed.What the CI coverage page measures
mpiwrap/launcher.cpp(native part, 50 lines) andmpiwrap.h(1 line) are compiled.mpiwrap.cpp,loader.cpp,fallbacks.cpp,tmpi.cppandsrc/thread_mpiare under!__PLUMED_HAS_MPIand are never measured.New regtests
basic/rt-mpiwrap-launcher-host(type=make, mpiprocs=2, includes<mpi.h>, so NOT_APPLICABLE in serial builds, also through the injection host):./exe standalone(plumed_regtest_after): standalone_owned rank mismatch, the launcher initializes and finalizes MPI before throwing; each process writes standalone-pid., all must be identical;./exe standalone-throw: callback exception with launcher-owned MPI aborts the job (non-zero exit, "callback failed; aborting MPI" on stderr). Not visible to gcov (MPI_Abort), checked for behaviour.basic/rt-plumed-runtime-kernel(type=plumed, needs tools:dlopen; NOT_APPLICABLE without a plumed-runtime executable): plumed-runtime with the working kernel gives the same output as plumed; with PLUMED_KERNEL pointing to a missing library,--mpi --no-mpiexits with code 1, nothing on stdout, the path reported on stderr.Result (cloud gcov MPI build, union with the CI lines)
failure:label, which ends with abort() on purpose (G. Bussi, 3111ca1: "terminate instead of entering collective finalization"); gcov writes nothing on abort.Serial-only code (not on the coverage page), measured in a cloud serial gcov build
Only the 86 basic tests with mpiprocs>0 plus rt-mpiwrap-*, run natively (internal thread-MPI) and through the
plumed mkmpi --executableOpenMPI host, union of the two:--enable-gcovin serial-mpi-injection (host mode only) or a serial -coverage- matrix variant (internal tMPI), with the lcov report uploaded to Codecov (it merges uploads of the same commit). Proposed to Carlo, not done.