examples/slurm: wait for the DVM to resize, and make cancel usable - #2642
Merged
rhc54 merged 2 commits intoAug 11, 2026
Merged
Conversation
A timeout does not withdraw the request: PMIx keeps the cbdata pointer and still runs the callback whenever the scheduler answers, by which time the submitting call may have returned and taken its stack frame with it. Reference count the wait object so the last one out frees it. Credits: AccelCom @ Barcelona Supercomputing Center Signed-off-by: Petter Sandås <petter.sandas@bsc.es>
A Slurm extend is answered twice now: once when the scheduler grants, and again when the DVM has finished resizing. This example took the first answer as the last word, so it reported success while the nodes it had been granted could not yet carry work. Register for PMIX_DVM_IS_READY and PMIX_ERR_DVM_MOD and correlate them with the request by PMIX_ALLOC_REQ_ID. Add a cancel command, and watch each request on its own thread so the prompt returns as soon as it is submitted. ras/slurm drops a request's cancellable record the moment the scheduler grants, and phase one does not answer until then, so waiting inline held the prompt for exactly as long as the request could still be withdrawn. Only an extend is cancellable, so only an extend takes a name. Verify an extend against the allocation its completion event names rather than against the DVM total, which is a snapshot taken before submitting that any concurrent request invalidates. Credits: AccelCom @ Barcelona Supercomputing Center Signed-off-by: Petter Sandås <petter.sandas@bsc.es>
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.
Problem
examples/slurm/elastic-coordination.ctreated the PMIx allocation callback asthe final answer to a size change. A Slurm extend now answers in two phases, so
the example reported success while the nodes it had just been granted could not
yet carry work. It also had no way to withdraw a pending request, and kept an
allocation request's wait object on the caller's stack.
Changes
examples/slurm: keep an allocation request's wait object aliveA timeout does not withdraw the request: PMIx still runs the callback whenever
the scheduler answers, by which time the submitting call may have returned and
taken its stack frame with it. The wait object is reference counted now.
Pre-existing bug, so it lands separately.
examples/slurm: wait for the DVM to resize, and make cancel usablePMIX_DVM_IS_READY/PMIX_ERR_DVM_MOD, correlating byPMIX_ALLOC_REQ_IDand claiming the slot before submitting — nothing ordersthe event after the phase-one callback.
what makes
cancelreachable:ras/slurmdrops a request's cancellablerecord when the scheduler grants, and phase one does not answer until then,
so waiting inline held the prompt for exactly as long as the request could
still be withdrawn.
cancel [REQUEST_NAME]andpending, andextend count N as REQUEST_NAMEso the name is short enough to type inside that window.
Generated names count requests in the session (
extend-1,shrink-2).naming anything else is refused locally rather than sent to return
PMIX_ERR_NOT_FOUND, which is indistinguishable from a typo.than the DVM total, which is a snapshot any concurrent request invalidates.
that job's allocation.