Learn R Programming

batchtools (version 0.9.3)

waitForJobs: Wait for Termination of Jobs

Description

This function simply waits until all jobs are terminated.

Usage

waitForJobs(ids = NULL, sleep = default.sleep, 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. Invalid ids are ignored.

sleep

[function(i) | numeric(1)] Function which returns the duration to sleep in the i-th iteration. Alternatively, you can pass a single positive numeric value.

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.