in src/slurm_plugin/clustermgtd.py [0:0]
def _retrieve_scheduler_partitions(nodes):
try:
ignored_nodes = []
partitions_name_map = ClusterManager._get_partition_info_with_retry()
log.debug("Partitions: %s", partitions_name_map)
for node in nodes:
if not node.partitions or any(p not in partitions_name_map for p in node.partitions):
# ignore nodes not belonging to any partition
ignored_nodes.append(node)
else:
for p in node.partitions:
partitions_name_map[p].slurm_nodes.append(node)
if ignored_nodes:
log.warning("Ignoring following nodes because they do not belong to any partition: %s", ignored_nodes)
return partitions_name_map
except Exception as e:
log.error("Failed when getting partition/node states from scheduler with exception %s", e)
raise