1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/JobCollection.R
\name{makeJobCollection}
\alias{makeJobCollection}
\alias{JobCollection}
\title{JobCollection Constructor}
\usage{
makeJobCollection(ids = NULL, resources = list(), reg = getDefaultRegistry())
}
\arguments{
\item{ids}{[\code{\link[base]{data.frame}} or \code{integer}]\cr
A \code{\link[base]{data.frame}} (or \code{\link[data.table]{data.table}})
with a column named \dQuote{job.id}.
Alternatively, you may also pass a vector of integerish job ids.
If not set, defaults to all jobs.
Invalid ids are ignored.}
\item{resources}{[\code{list}]\cr
Named list of resources. Default is \code{list()}.}
\item{reg}{[\code{\link{Registry}}]\cr
Registry. If not explicitly passed, uses the default registry (see \code{\link{setDefaultRegistry}}).}
}
\value{
[\code{JobCollection}].
}
\description{
\code{makeJobCollection} takes multiple job ids and creates an object of class \dQuote{JobCollection} which holds all
necessary information for the calculation with \code{\link{doJobCollection}}. It is implemented as an environment
with the following variables:
\describe{
\item{file.dir}{\code{file.dir} of the \link{Registry}.}
\item{work.dir:}{\code{work.dir} of the \link{Registry}.}
\item{job.hash}{Unique identifier of the job. Used to create names on the file system.}
\item{jobs}{\code{\link[data.table]{data.table}} holding individual job information. See examples.}
\item{log.file}{Location of the designated log file for this job.}
\item{resources:}{Named list of of specified computational resources.}
\item{uri}{Location of the job description file (saved with \code{link[base]{saveRDS}} on the file system.}
\item{seed}{\code{integer(1)} Seed of the \link{Registry}.}
\item{packages}{\code{character} with required packages to load via \code{\link[base]{require}}.}
\item{namespaces}{code{character} with required packages to load via \code{\link[base]{requireNamespace}}.}
\item{source}{\code{character} with list of files to source before execution.}
\item{load}{\code{character} with list of files to load before execution.}
\item{array.var}{\code{character(1)} of the array environment variable specified by the cluster functions.}
\item{array.jobs}{\code{logical(1)} signaling if jobs were submitted using \code{chunks.as.arrayjobs}.}
}
If your \link{ClusterFunctions} uses a template, \code{\link[brew]{brew}} will be executed in the environment of such
a collection. Thus all variables available inside the job can be used in the template.
}
\examples{
\dontshow{ batchtools:::example_push_temp(1) }
tmp = makeRegistry(file.dir = NA, make.default = FALSE, packages = "methods")
batchMap(identity, 1:5, reg = tmp)
# resources are usually set in submitJobs()
jc = makeJobCollection(1:3, resources = list(foo = "bar"), reg = tmp)
ls(jc)
jc$resources
}
\seealso{
Other JobCollection:
\code{\link{doJobCollection}()}
}
\concept{JobCollection}
|