Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions azure-slurm/slurmcc/cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CostSlurm:
def __init__(self, start:str, end: str, cluster: str, cache_root: str, fmt: str=None) -> None:

self.start = start
self. end = end
self.end = end
self.cluster = cluster
self.sacct = shutil.which("sacct")
if not self.sacct:
Expand Down Expand Up @@ -137,7 +137,11 @@ def process_queue(self) -> dict:
data = json.load(fp)

for job in data['jobs']:
if job['job_state'] != 'RUNNING' and job['job_state'] != 'CONFIGURING':
# job_state is a list in newer Slurm versions (e.g., ['RUNNING', 'CONFIGURING', 'POWER_UP_NODE'])
job_states = job['job_state']
if isinstance(job_states, str):
job_states = [job_states]
if 'RUNNING' not in job_states and 'CONFIGURING' not in job_states:
continue
job_id = job['job_id']
if job['admin_comment']:
Expand Down
Loading