makeRegistry: Construct a registry object.

View source: R/Registry.R

makeRegistryR Documentation

Construct a registry object.

Description

Note that if you don't want links in your paths (file.dir, work.dir) to get resolved and have complete control over the way the path is used internally, pass an absolute path which begins with “/”.

Usage

makeRegistry(
  id,
  file.dir,
  sharding = TRUE,
  work.dir,
  multiple.result.files = FALSE,
  seed,
  packages = character(0L),
  src.dirs = character(0L),
  src.files = character(0L),
  skip = TRUE
)

Arguments

id

[character(1)]
Name of registry. Displayed e.g. in mails or in cluster queue.

file.dir

[character(1)]
Path where files regarding the registry / jobs should be saved. Default is “<id>-files” in current working directory if id is set.

sharding

[logical(1)]
Enable sharding to distribute result files into different subdirectories? Important if you have many experiments. Default is TRUE.

work.dir

[character(1)]
Working directory for R process when experiment is executed. Default is the current working directory when registry is created.

multiple.result.files

[logical(1)]
Should a result file be generated for every list element of the returned list of the job function? Note that the function provided to batchMap or batchReduce must return a named list if this is set to TRUE. The result file will be named “<id>-result-<element name>.RData” instead of “<id>-result.RData”. Default is FALSE.

seed

[integer(1)]
Start seed for experiments. The first experiment in the registry will use this seed, for the subsequent ones the seed is incremented by 1. Default is a random number from 1 to .Machine$integer.max/2.

packages

[character]
Packages that will always be loaded on each node. Default is character(0).

src.dirs

[character]
Directories containing R scripts to be sourced on registry load (both on slave and master). Files not matching the pattern “\.[Rr]$” are ignored. Useful if you have many helper functions that are needed during the execution of your jobs. These files should only contain function definitions and no executable code. Default is character(0).

src.files

[character]
R scripts files to be sourced on registry load (both on slave and master). Useful if you have many helper functions that are needed during the execution of your jobs. These files should only contain function and constant definitions and no long running, executable code. These paths are considered to be relative to your work.dir. As a last remedy in problematic cases you can use absolute paths, by passing paths that start with “/”, see the comment about file.dir and work.dir above, where we allow the same thing. Note that this is a less portable approach and therefore usually a less good idea. Default is character(0).

skip

[logical(1)]
Skip creation of a new registry if a registry is found in file.dir. Defaults to TRUE.

Details

Every object is a list that contains the passed arguments of the constructor.

Value

[Registry]

Examples

reg = makeRegistry(id = "BatchJobsExample", file.dir = tempfile(), seed = 123)
print(reg)

BatchJobs documentation built on March 21, 2022, 5:05 p.m.