This function simply waits until all jobs are terminated.
Usage
waitForJobs(
ids = NULL,
sleep = NULL,
timeout = 604800,
expire.after = NULL,
stop.on.error = FALSE,
stop.on.expire = FALSE,
reg = getDefaultRegistry()
)
Arguments
- ids
[
data.frame
orinteger
]
Adata.frame
(ordata.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 offindSubmitted
. Invalid ids are ignored.- sleep
[
function(i)
|numeric(1)
]
Parameter to control the duration to sleep between queries. You can pass an absolute numeric value in seconds or afunction(i)
which returns the number of seconds to sleep in thei
-th iteration. If not provided (NULL
), tries to read the value (number/function) from the configuration file (stored inreg$sleep
) or defaults to a function with exponential backoff between 5 and 120 seconds.- timeout
[
numeric(1)
]
After waitingtimeout
seconds, show a message and returnFALSE
. 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 toInf
. Default is604800
(one week).- expire.after
[
integer(1)
]
Jobs count as “expired” if they are not found on the system but have not communicated back their results (or error message). This frequently happens on managed system if the scheduler kills a job because the job has hit the walltime or request more memory than reserved. On the other hand, network file systems often require several seconds for new files to be found, which can lead to false positives in the detection heuristic.waitForJobs
treats such jobs as expired after they have not been detected on the system forexpire.after
iterations. If not provided (NULL
), tries to read the value from the configuration file (stored inreg$expire.after
), and finally defaults to3
.- stop.on.error
[
logical(1)
]
Immediately cancel if a job terminates with an error? Default isFALSE
.- stop.on.expire
[
logical(1)
]
Immediately cancel if jobs are detected to be expired? Default isFALSE
. Expired jobs will then be ignored for the remainder ofwaitForJobs()
.- reg
[
Registry
]
Registry. If not explicitly passed, uses the default registry (seesetDefaultRegistry
).