Skip to content

Expose per-node job memory to slurmd Prolog#211

Open
fabrizio2210 wants to merge 1 commit into
SchedMD:masterfrom
fabrizio2210:agent/expose-prolog-job-memory
Open

Expose per-node job memory to slurmd Prolog#211
fabrizio2210 wants to merge 1 commit into
SchedMD:masterfrom
fabrizio2210:agent/expose-prolog-job-memory

Conversation

@fabrizio2210

@fabrizio2210 fabrizio2210 commented Jul 10, 2026

Copy link
Copy Markdown

Summary

Expose SLURM_JOB_ALLOC_MEM_PER_NODE to slurmd Prolog scripts. The value is the effective job memory allocation for the current slurmd node, in MiB.

Implementation

  • Map the current node into the credential job host list and select its value from the compressed per-node memory allocation arrays.
  • Handle batch credentials, which carry only the batch node's memory allocation.
  • Skip the variable and log at debug level when the value cannot be determined.
  • Document the variable and cover it in the existing Prolog environment test.

This does not add an RPC or change scheduling or memory enforcement behavior. The variable is intentionally available only in slurmd Prolog, not Epilog.

Testing

  • make -j4
  • ./run-tests -i '31.3' (new assertion passed; 17 subtests passed, 2 optional GPU/MPS subtests skipped, 0 failed)
  • git clang-format --diff origin/master -- src/plugins/prep/script/prep_script_slurmd.c
  • pre-commit run --show-diff-on-failure --files doc/html/prolog_epilog.shtml src/plugins/prep/script/prep_script_slurmd.c testsuite/expect/test31.3
  • git diff --check origin/master...HEAD

Changelog: Add SLURM_JOB_ALLOC_MEM_PER_NODE to the slurmd Prolog
 environment with effective memory allocation for the current node.
Signed-off-by: Fabrizio Waldner <fabrizio@nebius.com>
@fabrizio2210 fabrizio2210 force-pushed the agent/expose-prolog-job-memory branch from 5167421 to bfaa260 Compare July 10, 2026 12:34
@fabrizio2210 fabrizio2210 marked this pull request as ready for review July 10, 2026 12:36
@fabrizio2210

Copy link
Copy Markdown
Author

@agilmor (randomly picking last active user in the repo, sorry), do you know what the procedure to merge this PR is?

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.

1 participant