Node
Note
This supersedes the pyslurm.node class, which will be removed in a future release
pyslurm.Node
A Slurm node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of a node |
None
|
Other Parameters:
Name | Type | Description |
---|---|---|
configured_gres |
dict
|
Configured GRES for the node |
address |
str
|
Address of the node |
hostname |
str
|
Hostname of the node |
extra |
str
|
Arbitrary extra string |
comment |
str
|
Comment for the node |
weight |
int
|
Weight associated to the node |
available_features |
list
|
Available features for the node |
active_features |
list
|
Active features for the node |
cpu_binding |
str
|
Default CPU-Binding for the node |
state |
str
|
State of the node |
reason |
str
|
Reason for the Node, typically used along with updating the node state |
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Name of the node. |
architecture |
str
|
Architecture of the node (e.g. x86_64) |
configured_gres |
dict
|
Generic Resources this Node is configured with. |
owner |
str
|
User that owns the Node. |
address |
str
|
Address of the node. |
hostname |
str
|
Hostname of the node. |
extra |
str
|
Arbitrary string attached to the Node. |
reason |
str
|
Reason why this node is in its current state. |
reason_user |
str
|
Name of the User who set the reason. |
comment |
str
|
Arbitrary node comment. |
bcast_address |
str
|
Address of the node for sbcast. |
slurm_version |
str
|
Version of slurm this node is running on. |
operating_system |
str
|
Name of the operating system installed. |
allocated_gres |
dict
|
Generic Resources currently in use on the node. |
mcs_label |
str
|
MCS label for the node. |
allocated_memory |
int
|
Memory in Mebibytes allocated on the node. |
real_memory |
int
|
Real Memory in Mebibytes configured for this node. |
free_memory |
int
|
Free Memory in Mebibytes on the node.
Note that this means actual free memory as returned by the |
idle_memory |
int
|
Idle Memory in Mebibytes on the node. |
memory_reserved_for_system |
int
|
Memory in Mebibytes reserved for the System not usable by Jobs. |
temporary_disk |
int
|
Amount of temporary disk space this node has, in Mebibytes. |
weight |
int
|
Weight of the node in scheduling. |
effective_cpus |
int
|
Number of effective CPUs the node has. |
total_cpus |
int
|
Total amount of CPUs the node has. |
sockets |
int
|
Number of sockets the node has. |
cores_reserved_for_system |
int
|
Number of cores reserved for the System not usable by Jobs. |
boards |
int
|
Number of boards the node has. |
cores_per_socket |
int
|
Number of cores per socket configured for the node. |
threads_per_core |
int
|
Number of threads per core configured for the node. |
available_features |
list
|
List of features available on the node. |
active_features |
list
|
List of features on the node. |
partitions |
list
|
List of partitions this Node is part of. |
boot_time |
int
|
Time the node has booted, as unix timestamp. |
slurmd_start_time |
int
|
Time the slurmd has started on the Node, as unix timestamp. |
last_busy_time |
int
|
Time this node was last busy, as unix timestamp. |
reason_time |
int
|
Time the reason was set for the node, as unix timestamp. |
allocated_tres |
dict
|
Currently allocated Trackable Resources |
allocated_cpus |
int
|
Number of allocated CPUs on the node. |
idle_cpus |
int
|
Number of idle CPUs. |
cpu_binding |
str
|
Default CPU-Binding on the node. |
current_watts |
int
|
Current amount of watts consumed on the node. |
avg_watts |
int
|
Average amount of watts consumed on the node. |
state |
str
|
State the node is currently in. |
next_state |
str
|
Next state the node will be in. |
cpu_load |
float
|
CPU Load on the Node. |
slurmd_port |
int
|
Port the slurmd is listening on the node. |
create(state='future')
method descriptor
Create a node.
Implements the slurm_create_node RPC.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state
|
str
|
An optional state the created Node should have. Allowed values
are |
'future'
|
Returns:
Type | Description |
---|---|
Node
|
This function returns the current Node-instance object itself. |
Raises:
Type | Description |
---|---|
RPCError
|
If creating the Node was not successful. |
Examples:
delete()
method descriptor
Delete a node.
Implements the slurm_delete_node RPC.
Raises:
Type | Description |
---|---|
RPCError
|
If deleting the Node was not successful. |
Examples:
load(name)
staticmethod
Load information for a specific node.
Implements the slurm_load_node_single RPC.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the Node to load. |
required |
Returns:
Type | Description |
---|---|
Node
|
Returns a new Node instance. |
Raises:
Type | Description |
---|---|
RPCError
|
If requesting the Node information from the slurmctld was not successful. |
Examples:
modify(changes)
method descriptor
Modify a node.
Implements the slurm_update_node RPC.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
changes
|
Node
|
Another Node object that contains all the changes to apply.
Check the |
required |
Raises:
Type | Description |
---|---|
RPCError
|
When updating the Node was not successful. |
Examples:
to_dict()
method descriptor
Node information formatted as a dictionary.
Returns:
Type | Description |
---|---|
dict
|
Node information as dict |
Examples:
pyslurm.Nodes
Bases: pyslurm.xcollections.MultiClusterMap
A Multi Cluster
collection of pyslurm.Node objects.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nodes
|
Union[list[str], dict[str, Node], str]
|
Nodes to initialize this collection with. |
None
|
Attributes:
Name | Type | Description |
---|---|---|
free_memory |
int
|
Amount of free memory in this node collection. (in Mebibytes)
Note that this means actual free memory as returned by the |
real_memory |
int
|
Amount of real memory in this node collection. (in Mebibytes) |
idle_memory |
int
|
Amount of idle memory in this node collection. (in Mebibytes) |
allocated_memory |
int
|
Amount of alloc Memory in this node collection. (in Mebibytes) |
total_cpus |
int
|
Total amount of CPUs in this node collection. |
idle_cpus |
int
|
Total amount of idle CPUs in this node collection. |
allocated_cpus |
int
|
Total amount of allocated CPUs in this node collection. |
effective_cpus |
int
|
Total amount of effective CPUs in this node collection. |
current_watts |
int
|
Total amount of Watts consumed in this node collection. |
avg_watts |
int
|
Amount of average watts consumed in this node collection. |
load(preload_passwd_info=False)
staticmethod
Load all nodes in the system.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preload_passwd_info
|
bool
|
Decides whether to query passwd and groups information from the system. Could potentially speed up access to attributes of the Node where a UID/GID is translated to a name. If True, the information will fetched and stored in each of the Node instances. The default is False. |
False
|
Returns:
Type | Description |
---|---|
Nodes
|
Collection of node objects. |
Raises:
Type | Description |
---|---|
RPCError
|
When getting all the Nodes from the slurmctld failed. |
modify(changes)
method descriptor
Modify all Nodes in a collection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
changes
|
Node
|
Another Node object that contains all the changes to apply.
Check the |
required |
Raises:
Type | Description |
---|---|
RPCError
|
When updating the Node was not successful. |
Examples: