Learn R Programming

batchtools (version 0.9.3)

getJobTable: Query Job Information

Description

getJobStatus returns the internal table which stores information about the computational status of jobs, getJobPars a table with the job parameters, getJobResources a table with the resources which were set to submit the jobs, and getJobTags the tags of the jobs (see Tags).

getJobTable returns all these tables joined.

Usage

getJobTable(ids = NULL, flatten = NULL, prefix = FALSE,
  reg = getDefaultRegistry())

getJobStatus(ids = NULL, reg = getDefaultRegistry())

getJobResources(ids = NULL, flatten = NULL, prefix = FALSE, reg = getDefaultRegistry())

getJobPars(ids = NULL, flatten = NULL, prefix = FALSE, reg = getDefaultRegistry())

getJobTags(ids = NULL, 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. Invalid ids are ignored.

flatten

[logical(1)] Transform the job parameters and/or resource specifications to data frame columns? Defaults to TRUE if all parameters (or resources) are scalar atomics. Otherwise each row of the column will hold a named list. New columns will be named using prefix.

prefix

[logical(1)] If set to TRUE, the prefix “par.” is used to name column names of parameters for a Registry and prefixes “prob.par.” and “algo.par.” are used to name the columns of a ExperimentRegistry. Resources are prefixed with “res.”.

reg

[Registry] Registry. If not explicitly passed, uses the default registry (see setDefaultRegistry).

Value

[data.table] with the following columns (not necessarily in this order):

job.id

Unique Job ID as integer.

submitted

Time the job was submitted to the batch system as POSIXct.

started

Time the job was started on the batch system as POSIXct.

done

Time the job terminated (successfully or with an error) as POSIXct.

error

Either NA if the job terminated successfully or the error message.

memory

Estimate of the memory usage.

batch.id

Batch ID as reported by the scheduler.

log.file

Log file. If missing, defaults to [job.hash].log.

job.hash

Unique string identifying the job or chunk.

time.queued

Time in seconds (as difftime) the job was queued.

time.running

Time in seconds (as difftime) the job was running.

pars

List of parameters/arguments for this job. Possibly expanded to separate columns (see prefix.

resources

List of computational resources set for this job. Possibly expanded to separate columns (see prefix.

tags

Tags as joined string, delimited by “,”.

problem

Only for ExperimentRegistry: the problem identifier.

algorithm

Only for ExperimentRegistry: the algorithm identifier.

Examples

Run this code
# NOT RUN {
tmp = makeRegistry(file.dir = NA, make.default = FALSE)
f = function(x) if (x < 0) stop("x must be > 0") else sqrt(x)
batchMap(f, x = c(-1, 0, 1), reg = tmp)
submitJobs(reg = tmp)
waitForJobs(reg = tmp)
addJobTags(1:2, "tag1", reg = tmp)
addJobTags(2, "tag2", reg = tmp)

# Complete table:
getJobTable(reg = tmp, flatten = FALSE)

# Job parameters:
getJobPars(reg = tmp, flatten = FALSE)

# Set and retrieve tags:
getJobTags(reg = tmp)

# Job parameters with tags right-joined:
rjoin(getJobPars(reg = tmp), getJobTags(reg = tmp))
# }

Run the code above in your browser using DataLab