Skip to content

Commit

Permalink
convert users from sched to resource status RPC
Browse files Browse the repository at this point in the history
Problem: the sched.resource-status RPC is slow when the scheduler
is busy, which makes python users and tools such as 'flux resource
status' unresponsive.

Now that resource.status returns a superset of of sched.resource-status
information, switch the python bindings, flux-top(1), and flux-resource(1)
to use resource.status.
  • Loading branch information
garlick committed Mar 15, 2024
1 parent edacaae commit 3ce6aad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/bindings/python/flux/job/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def __init__(self, uri=None):
if not uri or SchedResourceList is None:
raise ValueError
handle = flux.Flux(str(uri))
future = handle.rpc("sched.resource-status")
future = handle.rpc("resource.status")
self.stats = StatsInfo(handle).update_sync()
self.resources = SchedResourceList(future.get())
self.initialized = True
Expand Down
4 changes: 2 additions & 2 deletions src/bindings/python/flux/resource/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class SchedResourceList:
"""
Encapsulate response from sched.resource-status query.
Encapsulate response from resource.status query.
The response will contain 3 Rv1 resource sets:
:ivar all: all resources known to scheduler
Expand Down Expand Up @@ -98,4 +98,4 @@ def resource_list(flux_handle):
Returns:
ResourceListRPC: a future representing the request.
"""
return ResourceListRPC(flux_handle, "sched.resource-status")
return ResourceListRPC(flux_handle, "resource.status")
6 changes: 3 additions & 3 deletions src/cmd/top/summary_pane.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ static void resource_continuation (flux_future_t *f, void *arg)

if (flux_rpc_get_unpack (f, "o", &o) < 0) {
if (errno != ENOSYS) /* Instance may not be up yet */
fatal (errno, "sched.resource-status RPC failed");
fatal (errno, "resource.status RPC failed");
}
else {
json_t *queue_constraint;
Expand All @@ -432,7 +432,7 @@ static void resource_continuation (flux_future_t *f, void *arg)
&sum->core.down,
&sum->gpu.down,
queue_constraint) < 0)
fatal (0, "error decoding sched.resource-status RPC response");
fatal (0, "error decoding resource.status RPC response");
}
flux_future_destroy (f);
sum->f_resource = NULL;
Expand Down Expand Up @@ -539,7 +539,7 @@ void summary_pane_query (struct summary_pane *sum)
{
if (!sum->f_resource) {
if (!(sum->f_resource = flux_rpc (sum->top->h,
"sched.resource-status",
"resource.status",
NULL,
0,
0))
Expand Down
4 changes: 1 addition & 3 deletions src/modules/resource/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
* ranks in the initial program for the same reason as above.
* - the 'resource.monitor-waitup' RPC allows a test to wait for some number
* of ranks to be up, where "up" is defined as having had an online event
* posted. Thus, after waiting, resource.status (flux resource status)
* should show those ranks up, while sched.resource-status
* (flux resource list command) may still show them down.
* posted.
*/

#if HAVE_CONFIG_H
Expand Down

0 comments on commit 3ce6aad

Please sign in to comment.