Skip to content

Use DMTCP's main branch - #544

Merged
xuyao00 merged 5 commits into
mpickpt:mainfrom
xuyao00:pr/dmtcp-main
Oct 26, 2026
Merged

xuyao00 merged 5 commits into
mpickpt:mainfrom
xuyao00:pr/dmtcp-main

Conversation

@xuyao00

@xuyao00 xuyao00 commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR moves MANA from DMTCP's 4.2-dev branch to its main branch, which is stable and will become DMTCP 5.0. It needs dmtcp/dmtcp#1311, which is now merged. The dmtcp submodule points at a39bd30f, the merged #1311 on DMTCP's main branch.

Before the move, I compared the two branches commit by commit. Every fix on 4.2-dev is also on main. Only three changes of 4.2-dev are missing, and MANA needs none of them: the 4.2.0 version, the event DMTCP_EVENT_RUNNING_AFTER (main has DMTCP_EVENT_RUNNING_AFTER_LAUNCH, _RESUME and _RESTART instead), and a new default for the program name prefix, which 4.2-dev changed in the generated configure only.

5 commits:

  • Build MANA as C++20: DMTCP's logging header needs C++20, for std::source_location and concepts. configure.ac now requires C++20, with the AX_CXX_COMPILE_STDCXX macro from DMTCP, and MANA compiles with -std=c++20. As before, autoconf 2.71 regenerates configure.
  • Use DMTCP's main branch: the submodule moves to main (7c683bef), and .gitmodules tracks main instead of master. About 90 calls of JASSERT, JWARNING, JTRACE and JNOTE become ASSERT, WARN, TRACE and NOTE of dmtcp_assert.h. MANA's configure drops --enable-logging and --enable-timing, because DMTCP's configure now rejects them. The lower half calls ThreadList::postRestart() with its new signature, (int restartPause).
  • No longer skip areas by name: MANA skipped every area named /dev/shm, /dev/kgni, /dev/xpmem, [heap] or /anon_hugepage. However, the lower half's areas with these names are never in MANA's list of the upper half's mappings. Therefore, the names dropped only upper-half memory, such as an application's POSIX shared memory.
  • Add a test of POSIX shared memory: shared_memory maps an object from shm_open() in each rank, and checks it in every iteration. Before the previous commit, the restarted ranks crashed with SIGSEGV.
  • Use DMTCP's new skip hook: the submodule moves to a39bd30f on main, which has Fixed guard pages reinstalled in skipped areas dmtcp/dmtcp#1311. #1311 gives dmtcp_skip_memory_region_ckpting() a new interface. MANA's definition now decides with one binary search of the live list of the upper half's mappings. In addition, it saves the range of an area inside the upper-half stack, and it passes a range that it saves on to the next plugin's definition.

Why dmtcp/dmtcp#1311

DMTCP's main branch reinstalls the guard pages of a process after restart. However, it also recorded the guard pages of the memory that MANA skips, which is the lower half. glibc 2.42 and later put a guard page at the low end of each thread stack, including the stacks of UCX's threads in the lower half. After restart, DMTCP put these guard pages into the new lower half's memory, and UCX crashed with SIGSEGV. In the CI's container (Ubuntu 26.04, MPICH 4.3 on UCX), 4 tests crashed this way in 4 runs of the blocking mode. With #1311, no test crashed in 3 runs. DMTCP's 4.2-dev branch records no guard pages.

Notes for review

Testing

autotest.py, 41 tests with the new shared_memory, on the last commit with the submodule at the head of #1311 (21400c16):

Where MPI library Polling Blocking
ubuntu:26.04 container, the CI's steps MPICH 4.3 (UCX) 41 of 41 41 of 41 in each of 3 runs, with no retries
Fedora 44 MPICH 5.0.1 41 of 41 40 of 41 (see below)

On Fedora 44, p2p_ssend_collective timed out once at a checkpoint in blocking mode, as it sometimes does on main. Its checkpoint hung in the drain, before any memory was written. The test then passed 10 of 10. In addition, test-mana-restart.py passed, and the first commit passed 4 tests with DMTCP's 4.2-dev branch. The third commit passed 7 tests, including shared_memory, in both modes.

After #1311 was merged, this PR was rebased onto main, and the submodule moved to a39bd30f. On Fedora 44 (MPICH 5.0.1), the CI's steps then passed: test-mana-restart.py 10 of 10, test-loader-debug.py 15 of 15, and autotest.py 41 of 41 in polling mode and 41 of 41 in blocking mode, with no retries.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Build & Configuration
    • Building now requires a C++20-capable compiler. Compiler checks account for Microsoft Visual C++ language-version reporting.
    • The --enable-timing and --enable-logging configuration options are no longer available.
  • Bug Fixes
    • Improved handling of checkpoint-saved memory regions, gaps, and stack ranges during memory checks.
  • Tests
    • Added end-to-end coverage for shared-memory operations across MPI ranks.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 48d9ba09-fbb3-4e6e-8724-45c201325144
Commits

Reviewing files that changed from the base of the PR and between 54bd7f7 and c31d674.

Files selected for processing: 1
  • mpi-proxy-split/mpi_plugin.cpp

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The pull request requires C++20 and updates compiler detection, MPI build settings, and DMTCP submodule references. It changes MPI checkpoint memory-range selection and migrates assertion and logging calls to DMTCP macros. It also adds a shared-memory MPI end-to-end test.

Changes: C++20 toolchain support

Layer / File(s) Summary
C++ standard detection
m4/ax_cxx_compile_stdcxx.m4, configure
Compiler checks now cover C++17 and C++20 in configure; the Autoconf macro adds C++20 and C++23 modes and MSVC-aware version checks.
C++20 requirement and build wiring
configure.ac, configure, mpi-proxy-split/Makefile_config.in
Configure now requires C++20, updates its feature macro, and removes the timing and logging options. Both MPI compiler configurations select C++20.

MPI checkpoint and shared-memory changes

Layer / File(s) Summary
DMTCP interfaces and lower-half restore
dmtcp, mpi-proxy-split/lower-half/lower-half.cpp, mpi-proxy-split/lower_half_ckpt.cpp
The DMTCP submodule reference changes. Lower-half restore code adopts DMTCP assertion and logging macros, and its post-restart callback now takes one integer.
Saved memory-range selection
mpi-proxy-split/mpi_plugin.cpp
The plugin removes its cached mmap list and selects, clips, or skips memory areas using saved mmap ranges and the upper-half stack.
MPI wrapper assertions and warnings
mpi-proxy-split/mpi-wrappers/*
MPI wrapper sources and the wrapper generator replace legacy assertion and warning macros with DMTCP macros.
MPI message replay and draining checks
mpi-proxy-split/p2p_drain_send_recv.cpp, mpi-proxy-split/p2p_log_replay.cpp, mpi-proxy-split/seq_num.cpp
These code paths retain their described checks and control flow while adopting DMTCP assertion and logging macros and adding diagnostic values.
Shared-memory end-to-end test
mpi-proxy-split/test/Makefile, mpi-proxy-split/test/autotest.py, mpi-proxy-split/test/shared_memory.c
The test targets add a two-rank test that validates sampled shared-memory values and an MPI-reduced checksum.

Priority: Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Other

Possibly related issues

  • Issue 485: The PR advances the DMTCP submodule and updates MANA for the DMTCP interface described by the issue.

Suggested reviewers: gc00, pera-noaa

Merge Risk: Minimal · up to c31d6

No confirmed issue blocks merging. The checkpoint memory-skip behavior remains unverified against the pinned DMTCP version.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 41.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 60 functions across 21 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Use DMTCP's main branch" matches the primary change. The PR moves MANA from DMTCP's 4.2-dev branch to main, and the .gitmodules change and dmtcp submodule commit bump implement that move. T…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Use DMTCP's main branch" matches the primary change. The PR moves MANA from DMTCP's 4.2-dev branch to main, and the .gitmodules change and dmtcp submodule commit bump implement that move. The title is short and specific. It does not mention the C++20 requirement, the memory-skip hook change, or the shared-memory test, but the title does not need to cover every detail.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

xuyao00 and others added 4 commits October 25, 2026 17:15
DMTCP's main branch requires C++20.  Its logging header, which MANA's
plugin and lower half include, uses std::source_location and
concepts.  Therefore, configure.ac now requires C++20, and MANA
compiles with -std=c++20.

MANA's copy of the AX_CXX_COMPILE_STDCXX macro knew only C++11 to
C++17.  This commit takes the newer macro from DMTCP.  As before,
autoconf 2.71 regenerates configure.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit moves the dmtcp submodule from 97ab11e4 on 4.2-dev to
7c683bef on main.  Every fix on 4.2-dev is also on main.  In addition,
.gitmodules now tracks main, instead of master.

DMTCP's main branch replaced jalib's jassert.h with dmtcp_assert.h.
Therefore, MANA's JASSERT(cond)(x).Text("msg") becomes
ASSERT(cond, "msg: x={}", x).  Likewise, JWARNING, JTRACE and JNOTE
become WARN, TRACE and NOTE.  TRACE is now turned on at run time, with
DMTCP_LOG_LEVEL=trace.  As a result, DMTCP's configure no longer
accepts --enable-logging, nor --enable-timing.  MANA's configure
passes its options on to DMTCP's configure.  Therefore, MANA's
configure drops both options too.

ThreadList::postRestart() now takes only the restart pause.  However,
the lower half called it with the old (double, int) signature.  This
signature is still in dmtcp.h, as PostRestartFnPtr_t.  Therefore, the
lower half now declares its own function type, with the new signature.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
MANA used to skip every area named /dev/shm, /dev/kgni, /dev/xpmem,
[heap] or /anon_hugepage.  It did so before it looked at its list of
the upper half's mappings, which the lower half's mmap wrapper keeps.
However, the lower half's areas with these names are never in this
list.  The list records the upper half's mmap calls only, and the heap
grows by brk instead.  Therefore, the names changed the decision only
for upper-half memory, which they dropped from the image.  For
example, they dropped an application's POSIX shared memory and named
semaphores in /dev/shm, and its MAP_HUGETLB memory.  The name
"/dev/zero" once dropped CUDA's staging buffers in the same way.  MANA
now decides by the list alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
An application's POSIX shared memory is a file in /dev/shm.  MPI
libraries map files in /dev/shm, too, but in the lower half.  The new
test shared_memory checks that MANA saves the application's object.
Each rank maps an object of its own, and fills it once.  In every
iteration, the rank then checks a few words of the object.  Before
the previous commit, MANA did not save this object, and the restarted
ranks crashed with SIGSEGV.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@xuyao00
xuyao00 marked this pull request as ready for review October 26, 2026 15:46
Copilot AI balanced review requested due to automatic review settings October 26, 2026 15:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@xuyao00
xuyao00 requested a review from gc00 October 26, 2026 18:21

@gc00 gc00 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Move the dmtcp submodule to a39bd30f, on DMTCP's main branch.  There,
dmtcp_skip_memory_region_ckpting() decides about the start of an area
only.  It returns 1 to skip [area->addr, *uncheckedAddr), or 0 to save
it, and it sets *uncheckedAddr to the first address that it has not
decided about.  DMTCP then asks again about the unchecked rest.

MANA's definition now decides with one binary search of the lower
half's list of the upper half's mappings.  It reads the live list.  In
contrast, the copy that the hook made at its first call misses memory
that DMTCP maps while it writes the image, such as its allocator's
chunks.  This matters now, because DMTCP also asks the hook while it
records guard pages, before it writes the image.  The upper-half
stack, which the lower half maps before its mmap wrapper exists, is
one more range of the upper half's memory.  Therefore, the range of an
area inside the stack is saved, whereas such an area was skipped
before.  Finally, a range that MANA saves goes on to the next
definition of the hook.  As a result, another plugin can still skip
some of it.
@xuyao00
xuyao00 merged commit 39ff043 into mpickpt:main Oct 26, 2026
2 checks passed
@xuyao00
xuyao00 deleted the pr/dmtcp-main branch October 26, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants