flux.resource.list module

class flux.resource.list.ResourceListRPC(flux_handle, topic, nodeid=0)

Bases: FutureExt

get()

Return a SchedResourceList corresponding to the request.

Blocks until the request is fulfilled.

class flux.resource.list.SchedResourceList(resp)

Bases: object

Encapsulate response from resource.sched-status query. The response will contain 3 Rv1 resource sets:

Variables
  • all -- all resources known to scheduler

  • down -- resources currently unavailable (drained or down)

  • allocated -- resources currently allocated to jobs

From these sets, the "up" and "free" resource sets are computed on-demand.

There is generally no need to instantiate this class directly. Instead, instances are returned by fetching the result of a resource_list() call.

filter(include)

Filter the reported resources in a ResourceList object :param include: restrict the current set of

reported ranks to the given ranks or hosts.

property free

All resources which are neither down nor allocated.

property up

All resources which are not down.

flux.resource.list.resource_list(flux_handle)

Send a request for a SchedResourceList object.

Parameters

flux_handle (flux.Flux) -- a Flux handle

Returns

a future representing the request.

Return type

ResourceListRPC