util
check_if_valid_host(queuetype, debug, hosttype=HostType.SUBMIT)
¶
Checks if the current host is a submit host.
Uses the qconf
program to determine if the current host is a submit host.
Need to implement a similar feature for SLURM.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
queuetype |
QueueType
|
What queue type to check. |
required |
debug |
bool
|
Used in development settings. SubmitHosts can be added in the |
required |
Raises:
Type | Description |
---|---|
CalledProcessError
|
When there is a problem with the |
NotASubmitHost
|
When the current host is not a submit host. |
NotImplementedError
|
When the queuetype is not supported. |
Returns:
Type | Description |
---|---|
bool
|
True for success or False for failure |
Source code in hpcman/hpcman/queue/util.py
check_valid_slurm_association(query, assoc_type='users', debug=False)
¶
Compares provided user or account to list of valid Slurm users or accounts
Suggested use is checking for True/False then raising InvalidSlurmUser or InvalidSlurmAccount
Also populates global ASSOCIATIONS variable that can be reused.
Source code in hpcman/hpcman/queue/util.py
check_valid_slurm_node(query)
¶
Compares provided node to list of valid Slurm nodes.
Populates the global NODES variable.
Source code in hpcman/hpcman/queue/util.py
check_valid_slurm_partition(query)
¶
Compares provided partition to list of valid Slurm partitions.
Populates the global PARTITIONS variable.
Source code in hpcman/hpcman/queue/util.py
get_allowed_accounts_per_partition()
¶
Uses pyslurm to get allowed accounts per partition
Source code in hpcman/hpcman/queue/util.py
get_job_info(job_id)
¶
Get job info from Slurm using pyslurm
Source code in hpcman/hpcman/queue/util.py
get_valid_slurm_associations()
¶
Loads associations in pyslurm to get a list of valid users and accounts
Source code in hpcman/hpcman/queue/util.py
give_suggestions(query, choices, suggestion_type, cutoff_min=50, cutoff_suggest=85)
¶
Provide suggestions from list using rapidfuzz
Source code in hpcman/hpcman/queue/util.py
is_nodes_set(value)
¶
is_partitions_set(value)
¶
load_nodes()
¶
load_partitions()
¶
Loads partitions into global PARTITIONS variable if needed.