Learn R Programming

batchtools (version 0.9.0)

makeJobCollection: JobCollection Constructor

Description

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
file.dir of the Registry.
work.dir:
work.dir of the Registry.
job.hash
Unique identifier of the job. Used to create names on the file system.
jobs
data.table holding individual job information. See examples.
log.file
Location of the designated log file for this job.
resources:
Named list of of specified computational resources.
uri
Location of the job description file (saved with link[base]{saveRDS} on the file system.
seed
integer(1) Seed of the Registry.
packages
character with required packages to load via require.
namespaces
codecharacter with required packages to load via requireNamespace.
source
character with list of files to source before execution.
load
character with list of files to load before execution.
array.var
character(1) of the array environment variable specified by the cluster functions.
n.array.jobs
integer(1) of the number of array jobs (i.e., the number of jobs in chunk if chunks.as.arrayjobs is TRUE and 1 otherwise.

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.

Usage

makeJobCollection(ids = NULL, resources = list(),
  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 all jobs.
resources
[list] Named list of resources. Default is list().
reg
[Registry] Registry. If not explicitly passed, uses the default registry (see setDefaultRegistry).

Value

[JobCollection].

See Also

Other JobCollection: doJobCollection

Examples

Run this code
tmp = makeRegistry(file.dir = NA, make.default = FALSE, packages = "methods")
batchMap(identity, 1:5, reg = tmp)
# resources are usually forwared from submitJobs()
jc = makeJobCollection(1:3, resources = list(foo = "bar"), reg = tmp)
print(ls.str(jc))

Run the code above in your browser using DataLab