def getJobAllocGPU(job, node_dict=None): if not node_dict: node_dict = pyslurm.node().get() if not job['cpus_allocated']: return None node_list = [node_dict[node] for node in job['cpus_allocated']] gpus_allocated = MyTool.getGPUAlloc_layout(node_list, job['gres_detail']) return gpus_allocated
def getJobAllocGPUonNode(job, node): gpus_allocated = MyTool.getGPUAlloc_layout([node], job['gres_detail']) if gpus_allocated: return gpus_allocated[node['name']] else: return []