makeJobCollection takes multiple job ids and creates an object of class “JobCollection” which holds all
necessary information for the calculation with doJobCollection. It is implemented as an environment
with the following variables:
file.dir of the Registry.
work.dir of the Registry.
Unique identifier of the job. Used to create names on the file system.
data.table holding individual job information. See examples.
Location of the designated log file for this job.
Named list of of specified computational resources.
Location of the job description file (saved with link[base]{saveRDS} on the file system.
integer(1) Seed of the Registry.
character with required packages to load via require.
character with required packages to load via requireNamespace.
character with list of files to source before execution.
character with list of files to load before execution.
character(1) of the array environment variable specified by the cluster functions.
logical(1) signaling if jobs were submitted using chunks.as.arrayjobs.
If your ClusterFunctions uses a template, brew will be executed in the environment of such
a collection. Thus all variables available inside the job can be used in the template.
makeJobCollection(ids = NULL, resources = list(), reg = getDefaultRegistry())[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 all jobs.
Invalid ids are ignored.
[list]
Named list of resources. Default is list().
[Registry]
Registry. If not explicitly passed, uses the default registry (see setDefaultRegistry).
[JobCollection].
Other JobCollection:
doJobCollection()
tmp = makeRegistry(file.dir = NA, make.default = FALSE, packages = "methods")
#> No readable configuration file found
#> Created registry in '/tmp/batchtools-example/reg' using cluster functions 'Interactive'
batchMap(identity, 1:5, reg = tmp)
#> Adding 5 jobs ...
# resources are usually set in submitJobs()
jc = makeJobCollection(1:3, resources = list(foo = "bar"), reg = tmp)
ls(jc)
#> [1] "array.jobs" "array.var" "compress" "file.dir" "job.hash"
#> [6] "job.name" "jobs" "load" "log.file" "namespaces"
#> [11] "packages" "resources" "seed" "source" "uri"
#> [16] "work.dir"
jc$resources
#> $foo
#> [1] "bar"
#>