qcg.pilotjob.allocation module

class qcg.pilotjob.allocation.CRAllocation(crtype, count)

Bases: object

Allocation of consumable resources

crtype

type of CR

Type

CRType

count

amount of allocated CR

Type

int

class qcg.pilotjob.allocation.CRBindAllocation(crtype, instances)

Bases: object

Allocation of bindable consumable resources

crtype

type of CR

Type

CRType

instances

instances of allocated CR

Type

list()

property count

number of instances of allocated CR

Type

int

class qcg.pilotjob.allocation.NodeAllocation(node, cores, crs)

Bases: object

Resource allocation on a single node, contains information about a node, along with the allocated cores and consumable resources.

_node

a node definition

Type

Node

_cores

allocated cores

Type

list(str)

_crs

allocated crs

Type

dict(CRType,CRAllocation|CRBindAllocation)

release()

Release resources allocated in this node allocation.

property cores

allocated cores on a node.

Type

list(str)

property ncores

number of allocated cores on a node.

Type

int

property crs

allocated crs on a node.

Type

dict((CRType, CRAllocation|CRBindAllocation))

property node

node information.

Type

Node

class qcg.pilotjob.allocation.Allocation

Bases: object

Resource allocation splited (possible) among many nodes.

_nodes

list of a single node allocation

Type

NodeAllocation[]

_cores

total number of cores on all nodes

Type

int

Initialize allocation.

add_node(node_allocation)

Add a node allocation.

Parameters

node_allocation (NodeAllocation) – description of an allocation on a single node

release()

Release allocated resources. Release resources allocated on all nodes in allocation.

Raises

InvalidResourceSpec – when number of cores to release on a node is greater than number of used cores.

property cores

Return total number of cores of an allocation

Returns

number of cores

Return type

int

property nodes

Return a list of node allocations

Returns

list of node allocations

Return type

list(NodeAllocation)

description()

Return a single line description of allocation

Returns

a single line description of allocation

Return type

str