flux-framework / flux-sched

Fluxion Graph-based Scheduler
GNU Lesser General Public License v3.0
84 stars 39 forks source link

[WIP] Add support for broker rank-based partial release #1163

Open milroy opened 1 month ago

milroy commented 1 month ago

Fluxion issue #1151 and flux-core issue 4312 describe the need for partially releasing broker resources. The first implementation of the functionality is scoped to releasing all resources managed by a single broker rank per RPC. Elasticity considerations will require arbitrary release of resources, but this capability may only be needed in the scheduler.

In its current WIP state, this PR adds capability to identify all boost graph vertices managed by a broker rank in the RV1 reader. The reader builds and returns a map keyed by the resource types, with values corresponding to the number of resources of that type to be removed. The cancellation of the vertices occurs in the RV1 reader, and the partial cancellation an pruning filter updates occurs in the traverser. Note that the map is under-specified relative to number of resources in the resource graph. The traverser uses vectors of types and counts that are ordered by their visit order. Since the reader may unpack and find the boost vertices in any order (and lookups need to be fast) a map is the better choice for container. The complexity of translating between map and vector containers was added to the planners in PR #1061.

The planner and planner_multi need modifications to handle span reduction based on the assembled reduction counts and types. They must deal with 0 entries for reduction, correctly treat a sequence of span reductions as a single span removal. A single partial cancellation that contains all planner or planner_multi resources must behave like a full span removal. The planners must also return whether the span was totally removed to the client.

The traverser begins a depth-first visit that stops as soon as it encounters a vertex untagged and cancelled by the RV1 reader. The traverser needs a new enum class to designate job modification traversal types. If the type is PARTIAL_CANCEL, the traverser must only untag and erase the jobid if the planner indicates that the removal constitutes a full removal.

Items remaining to be completed to remove the WIP tag: