Learn R Programming

slurmR (version 0.5-4)

wait_slurm: Wait for a Slurm job to be completed

Description

Wait for a Slurm job to be completed

Usage

wait_slurm(x, ...)

# S3 method for slurm_job wait_slurm(x, ...)

# S3 method for integer wait_slurm(x, timeout = -1, freq = 0.1, force = TRUE, ...)

Value

Invisible NULL.

Arguments

x

Either a job id number, or an object of class slurm_job.

...

Further arguments passed to the method

timeout

Integer. Maximum wait time in seconds. If timeout < 0 then the command will only return when the job finishes.

freq

Frequency in seconds to query for the state of the job.

force

Logical scalar. When TRUE, if the job is not found after checking for its status, the function will continue to wait still.

Examples

Run this code
# Waiting is only available if there are Slurm clusters
if (slurm_available()) {
  job <- Slurm_EvalQ(Sys.sleep(1000), plan = "submit", njobs = 2)
  wait_slurm(job, timeout = 1) # This will return a warning
  scancel(job)   
  Slurm_clean(job)
}

Run the code above in your browser using DataLab