flux.resource.status module

class flux.resource.status.DrainInfo(ranks: IDset, timestamp: float, reason: str)

Bases: NamedTuple

Drained resource information tuple. .. attribute:: timestamp

timestamp at which resource was drained

type

float

reason

message recorded when resources were drained

Type

str

ranks

idset of drain ranks with this reason and timestamp

Type

IDset

ranks: IDset

Alias for field number 0

reason: str

Alias for field number 2

timestamp: float

Alias for field number 1

class flux.resource.status.ResourceStatus(rstatus=None, allocated_ranks=None)

Bases: object

Container for combined information from resource module and scheduler.

nodelist

rank ordered set of hostnames

Type

Hostlist

all

idset of all known ranks

Type

IDset

avail

idset of ranks not excluded or drained

Type

IDset

offline

idset of ranks currently offline

Type

IDset

online

idset of ranks currently online

Type

IDset

exclude

idset of ranks excluded by configuration

Type

IDset

allocated

idset of ranks with one or more jobs

Type

IDset

drained

idset of ranks drained and not allocated

Type

IDset

draining

idset of ranks drained and allocated

Type

IDset

drain_info

list of DrainInfo object for drain ranks

Type

list

filter(include)

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

reported ranks to the given ranks or hosts.

get_drain_info(rank)

Find and return the DrainInfo object for rank rank

get_idset(*args)

Return an idset of ranks that are the union of all states in args

class flux.resource.status.ResourceStatusRPC(handle)

Bases: object

A ResourceStatusRPC encapsulates a query to both the resource module and scheduler and returns a ResourceStatus object.

get()

Return a ResourceStatus object corresponding to the request Blocks until all RPCs are fulfilled

get_allocated_ranks()
get_status()
flux.resource.status.resource_status(flux_handle)

Initiate RPCs to scheduler and resource module and return a ResourceStatus object holding the result.

Parameters

flux_handle (flux.Flux) -- a Flux handle

Returns

A future representing the request. Call .get()

to get the ResourceStatus result.

Return type

ResourceStatusRPC