Skip to content

Commit

Permalink
Inline active_status
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Aug 29, 2023
1 parent e3f595f commit 59b5851
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/clib/lib/job_queue/slurm_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ class SlurmStatus {

void new_job(int job_id) { this->update(job_id, JOB_QUEUE_PENDING); }

static bool active_status(job_status_type status) {
return (status == JOB_QUEUE_PENDING || status == JOB_QUEUE_RUNNING);
}

/**
This function is used when the status of the jobs is updated with squeue. The
semantics is as follows:
Expand Down Expand Up @@ -75,7 +71,8 @@ class SlurmStatus {

auto squeue_pair = squeue_jobs.find(job_id);
if (squeue_pair == squeue_jobs.end()) {
if (this->active_status(job_status))
if ((job_status == JOB_QUEUE_PENDING ||
job_status == JOB_QUEUE_RUNNING))
active_jobs.push_back(job_id);
} else
this->jobs[job_id] = squeue_pair->second;
Expand Down

0 comments on commit 59b5851

Please sign in to comment.