status: Check the status of a Slurm JOB

View source: R/status.R

statusR Documentation

Check the status of a Slurm JOB

Description

Using the sacct function, it checks the status of a particular job and returns information about its current state, with details regarding the jobs (if an array) that are done, running, pending, or failed.

Usage

status(x)

## S3 method for class 'slurm_job'
status(x)

## Default S3 method:
status(x)

## S3 method for class 'slurm_status'
x$name

Arguments

x

Either a Job id, an object of class slurm_job, or an object of class slurm_status.

name

Character scalar. List of status to retrieve. This can be any of "done", "failed", "running", or "pending".

Value

An integer with attributes of class slurm_status. The attributes are integer vectors indicating which jobs fail in the categories of done, failed, pending, and running (see JOB_STATE_CODES). Possible return values are:

  • -1: No job found. This may be a false negative as the job may still be on it's way to be submitted.

  • 0: Job completed.

  • 1: All jobs are pending resource allocation or are on it's way to start.

  • 2: All jobs are currently running.

  • 3: One or more jobs are still running.

  • 99: One or more jobs failed.

If the job is not an array, then function will return the corresponding code but the attributes will only have a single number, 1, according to the state of the job (completed, failed, pending).

See Also

Other utilities: Slurm_clean(), Slurm_env(), Slurm_log(), WhoAmI(), parse_flags(), snames()

Other post submission: Slurm_clean(), Slurm_collect(), Slurm_log()

Examples

## Not run: 

x <- Slurm_EvalQ(Sys.sleep(100), njobs = 2)

status(x) # A possible result: An integer with attributes
# Status: All jobs are pending resource allocation or are on it's way to start. (Code 1)
# This is a job array. The status of each job, by array id, is the following:
# done      :  -
# failed    :  -
# pending   : 1, 2.
# running   :  -


## End(Not run)

slurmR documentation built on Aug. 30, 2023, 5:06 p.m.