mstar.engine.resources.admission#
Admission across the resources of one runner, see Resource.ask.
Classes
|
The queues of the resources that ask, and the nodes each request was admitted on. |
|
A waiting request that didn't fit, the resource that refused it, the node it asked that resource for, and the mark that resource returned. |
- class mstar.engine.resources.admission.Admission(resources, ask_order)[source]#
Bases:
objectThe queues of the resources that ask, and the nodes each request was admitted on.
A waiting request is admitted once it is first in every queue it is in and each resource it asked reserves for it, all or nothing. It may also pass the first request of a queue whose resource overrides Resource.reserve_past, while that request can’t start (_pass), and stand anywhere in the queue of such a resource once it asks nothing more of the request (Resource.ask), since that takes nothing from the requests ahead of it. A request that asks again (readmit) waits in no queue, and admit_waiting tries it, oldest first, whenever what it didn’t fit has grown. It holds up no newer request unless it is the oldest request that has asked a resource it waits for, when that resource’s queue admits no one it hasn’t already reserved for, so newer prompts can’t keep passing it.
- admit(rid, node_name, graph_walk, published, keys)[source]#
None once
ridis admitted onnode_name, else why it waits or fails.keysare the resources ofnode_namethat ask.- Parameters:
rid (str)
node_name (str)
graph_walk (str)
published (Mapping[str, PublishedInfo] | None)
keys (Collection[str])
- Return type:
FullAdmitOutcome | None
- admit_waiting(published_of)[source]#
Admit each return that now fits, oldest first, then each waiting request that is now first in every queue it is in, held back by no return, and fits, then each that passes a first request that can’t start, or waits where a resource holds what it asked for, in arrival order, and return the (node, rid) pairs that may start.
published_of(rid, node)gives what the request published for that node’s resources.Nothing is tried until a resource whose first waiting request didn’t fit has grown, a mark that requests passing were refused against has grown, or a queue has a new first request, and a return is tried once it starts to return or what it didn’t fit has grown. A pass that changed none of these costs one Resource.grew_since for each such resource, mark and return.
- newer_than(rid)[source]#
The requests numbered after
rid, newest first, or None when the conductor gaveridno number.
- older_than(rid)[source]#
The requests numbered before
rid, newest first, or none when the conductor gaveridno number.
- readmit(rid, node_name, keys)[source]#
Ask
node_name’s resources again forrid, since a drop or a move to the host may have given back what they admitted it with. A resource that did asks now, andridwaits as a return unless it already waits as a new request.keysare the resources ofnode_namethat ask.- Parameters:
rid (str)
node_name (str)
keys (Collection[str])
- Return type:
None
- class mstar.engine.resources.admission.Refusal(rid, key, node_name, mark)[source]#
Bases:
NamedTupleA waiting request that didn’t fit, the resource that refused it, the node it asked that resource for, and the mark that resource returned.