Learn R Programming

batchtools (version 0.9.0)

waitForJobs: Wait for Termination of Jobs

Description

This function simply waits until all jobs are terminated.

Usage

waitForJobs(ids = NULL, sleep = 10, timeout = 604800,
  stop.on.error = FALSE, reg = getDefaultRegistry())

Arguments

ids
[data.frame or integer] A data.frame (or data.table) with a column named “job.id”. Alternatively, you may also pass a vector of integerish job ids. If not set, defaults to the return value of findSubmitted.
sleep
[numeric(1)] Seconds to sleep between status updates. Default is 10.
timeout
[numeric(1)] After waiting timeout seconds, show a message and return FALSE. This argument may be required on some systems where, e.g., expired jobs or jobs on hold are problematic to detect. If you don't want a timeout, set this to Inf. Default is 604800 (one week).
stop.on.error
[logical(1)] Immediately cancel if a job terminates with an error? Default is FALSE.
reg
[Registry] Registry. If not explicitly passed, uses the default registry (see setDefaultRegistry).

Value

[logical(1)]. Returns TRUE if all jobs terminated successfully and FALSE if either the timeout is reached or at least one job terminated with an exception.