From a49ba81d8bd8e52b62d92b37a539a69f7253321d Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Mon, 16 Dec 2024 13:38:46 -0800 Subject: [PATCH] qmanager: use SCHEDUTIL_HELLO_PARTIAL_OK flag Problem: when the scheduler is reloaded, housekeeping jobs with partially allocated resources are canceled rather than being sent to the scheduler for re-allocation during the hello handshake. This is because there was no way for the job manager to inform the scheduler of the free R subset. However, RFC 27 now specifies that the sched.hello request may contain a 'partial-ok' flag. If set, hello responses may include a 'free' key containing an RFC 22 idset, with ids corresponding to ranks of R that are free. Schedutil wraps this so that if schedutil_create() is called with the SCHEDUTIL_HELLO_PARTIAL_OK flag, then - the hello request includes partial-ok - free ranks, if any, are subtracted from R in each response message before calling the scheduler's callback Note that the scheduling key (JGF), if present, always contains the original, full resource set. Set SCHEDUTIL_HELLO_PARTIAL_OK flag if defined by flux-core. --- qmanager/modules/qmanager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qmanager/modules/qmanager.cpp b/qmanager/modules/qmanager.cpp index 16e9cbca4..abbc1ca74 100644 --- a/qmanager/modules/qmanager.cpp +++ b/qmanager/modules/qmanager.cpp @@ -555,9 +555,14 @@ static std::shared_ptr qmanager_new (flux_t *h) ctx = nullptr; goto done; } + int schedutil_flags = 0; +#ifdef SCHEDUTIL_HELLO_PARTIAL_OK + // flag was added in flux-core 0.70.0 + schedutil_flags |= SCHEDUTIL_HELLO_PARTIAL_OK; +#endif if (!(ctx->schedutil = schedutil_create (ctx->h, - 0, + schedutil_flags, &ops, std::static_pointer_cast (ctx).get ()))) { flux_log_error (ctx->h, "%s: schedutil_create", __FUNCTION__);