This is the constructor used to create custom cluster functions. Note that some standard implementations for TORQUE, Slurm, LSF, SGE, etc. ship with the package.
Usage
makeClusterFunctions(
name,
submitJob,
killJob = NULL,
listJobsQueued = NULL,
listJobsRunning = NULL,
array.var = NA_character_,
store.job.collection = FALSE,
store.job.files = FALSE,
scheduler.latency = 0,
fs.latency = 0,
hooks = list()
)
Arguments
- name
[
character(1)
]
Name of cluster functions.- submitJob
[
function(reg, jc, ...)
]
Function to submit new jobs. Must return aSubmitJobResult
object. The arguments arereg
(Registry
) andjobs
(JobCollection
).- killJob
[
function(reg, batch.id)
]
Function to kill a job on the batch system. Make sure that you definitely kill the job! Return value is currently ignored. Must have the argumentsreg
(Registry
) andbatch.id
(character(1)
as returned bysubmitJob
). Note that there is a helper functioncfKillJob
to repeatedly try to kill jobs. SetkillJob
toNULL
if killing jobs cannot be supported.- listJobsQueued
[
function(reg)
]
List all queued jobs on the batch system for the current user. Must return an character vector of batch ids, same format as they are returned bysubmitJob
. SetlistJobsQueued
toNULL
if listing of queued jobs is not supported.- listJobsRunning
[
function(reg)
]
List all running jobs on the batch system for the current user. Must return an character vector of batch ids, same format as they are returned bysubmitJob
. It does not matter if you return a few job ids too many (e.g. all for the current user instead of all for the current registry), but you have to include all relevant ones. Must have the argument arereg
(Registry
). SetlistJobsRunning
toNULL
if listing of running jobs is not supported.- array.var
[
character(1)
]
Name of the environment variable set by the scheduler to identify IDs of job arrays. Default isNA
for no array support.- store.job.collection
[
logical(1)
]
Flag to indicate that the cluster function implementation ofsubmitJob
can not directly handleJobCollection
objects. If set toFALSE
, theJobCollection
is serialized to the file system before submitting the job.- store.job.files
[
logical(1)
]
Flag to indicate that job files need to be stored in the file directory. If set toFALSE
(default), the job file is created in a temporary directory, otherwise (or if the debug mode is enabled) in the subdirectoryjobs
of thefile.dir
.- scheduler.latency
[
numeric(1)
]
Time to sleep after important interactions with the scheduler to ensure a sane state. Currently only triggered after callingsubmitJobs
.- fs.latency
[
numeric(1)
]
Expected maximum latency of the file system, in seconds. Set to a positive number for network file systems like NFS which enables more robust (but also more expensive) mechanisms to access files and directories. Usually safe to set to0
to disable the heuristic, e.g. if you are working on a local file system.- hooks
[
list
]
Named list of functions which will we called on certain events like “pre.submit” or “post.sync”. See Hooks.
See also
Other ClusterFunctions:
makeClusterFunctionsDocker()
,
makeClusterFunctionsInteractive()
,
makeClusterFunctionsLSF()
,
makeClusterFunctionsMulticore()
,
makeClusterFunctionsOpenLava()
,
makeClusterFunctionsSGE()
,
makeClusterFunctionsSSH()
,
makeClusterFunctionsSlurm()
,
makeClusterFunctionsSocket()
,
makeClusterFunctionsTORQUE()
Other ClusterFunctionsHelper:
cfBrewTemplate()
,
cfHandleUnknownSubmitError()
,
cfKillJob()
,
cfReadBrewTemplate()
,
makeSubmitJobResult()
,
runOSCommand()