From 7c3218629f4cb5f733f9d97c74b3c1b902b66c52 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 17 Jul 2026 17:43:33 +0200 Subject: [PATCH] contrib: document required Hydra PMI_FD DMTCP patch --- ...1-ipc-skip-socket-scan-when-PMI_FD-is-set.patch | 12 ++++++++++++ contrib/dmtcp-patches/README.md | 13 +++++++++++++ contrib/dmtcp-patches/apply.sh | 14 ++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 contrib/dmtcp-patches/0001-ipc-skip-socket-scan-when-PMI_FD-is-set.patch create mode 100644 contrib/dmtcp-patches/README.md create mode 100755 contrib/dmtcp-patches/apply.sh diff --git a/contrib/dmtcp-patches/0001-ipc-skip-socket-scan-when-PMI_FD-is-set.patch b/contrib/dmtcp-patches/0001-ipc-skip-socket-scan-when-PMI_FD-is-set.patch new file mode 100644 index 000000000..b86b8b71f --- /dev/null +++ b/contrib/dmtcp-patches/0001-ipc-skip-socket-scan-when-PMI_FD-is-set.patch @@ -0,0 +1,12 @@ +--- a/src/plugin/ipc/socket/socketconnlist.cpp ++++ b/src/plugin/ipc/socket/socketconnlist.cpp +@@ -257,7 +257,8 @@ + + if ((getenv("SLURM_JOBID")) || + (getenv("SLURM_JOB_ID")) || +- (getenv("HYDI_CONTROL_FD"))) { ++ (getenv("HYDI_CONTROL_FD")) || ++ (getenv("PMI_FD"))) { + return; + } + diff --git a/contrib/dmtcp-patches/README.md b/contrib/dmtcp-patches/README.md new file mode 100644 index 000000000..9584bc97f --- /dev/null +++ b/contrib/dmtcp-patches/README.md @@ -0,0 +1,13 @@ +# Required Hydra `PMI_FD` downstream patch + +This directory records the exact DMTCP source delta required by the contributor's validated MANA/MPICH/Hydra environment. + +Apply locally for testing: + +```bash +bash contrib/dmtcp-patches/apply.sh +``` + +The helper modifies only the checked-out DMTCP submodule source and is idempotent. The resulting dirty submodule contents are for validation only and must be restored before committing this MANA draft branch. + +This draft intentionally asks the MANA maintainers to decide whether the final solution should be a temporary downstream patch, an in-tree MANA compatibility fix, a direct DMTCP contribution, or another design. diff --git a/contrib/dmtcp-patches/apply.sh b/contrib/dmtcp-patches/apply.sh new file mode 100755 index 000000000..deb036b1e --- /dev/null +++ b/contrib/dmtcp-patches/apply.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail +mana_root="$(cd "$(dirname "$0")/../.." && pwd)" +patch="$mana_root/contrib/dmtcp-patches/0001-ipc-skip-socket-scan-when-PMI_FD-is-set.patch" +source_file="$(git -C "$mana_root/dmtcp" grep -l 'HYDI_CONTROL_FD' -- '*socketconnlist.cpp' | head -n 1)" +[[ -n "$source_file" ]] || { echo "ERROR: socketconnlist.cpp not found" >&2; exit 1; } +if git -C "$mana_root/dmtcp" grep -q 'getenv("PMI_FD")' -- "$source_file"; then + echo "PMI_FD is already present in dmtcp/$source_file" + exit 0 +fi +git -C "$mana_root/dmtcp" apply "$patch" +git -C "$mana_root/dmtcp" diff --check +echo "Applied $patch to the local DMTCP submodule checkout." +echo "Do not commit dirty submodule contents in this draft PR."