Submit an expression to be evaluated to multiple jobs.

Slurm_EvalQ(
  expr,
  njobs = 2L,
  job_name = opts_slurmR$get_job_name(),
  tmp_path = opts_slurmR$get_tmp_path(),
  plan = "collect",
  sbatch_opt = list(),
  rscript_opt = list(),
  seeds = NULL,
  compress = TRUE,
  export = NULL,
  export_env = NULL,
  libPaths = .libPaths(),
  hooks = NULL,
  overwrite = TRUE,
  preamble = NULL
)

Arguments

expr

An expression to be passed to Slurm.

njobs

Integer. Number of jobs to use in the job-array. This specifies the number of R sessions to initialize. This does not specify the number of cores to be used.

job_name

Character. Name of the job to be passed to Slurm.

tmp_path

Character. Path to the directory where all the data (including scripts) will be stored. Notice that this path must be accessible by all the nodes in the network (See opts_slurmR).

plan

A character scalar. (See the_plan).

sbatch_opt

List of options to be passed to sbatch. This is usually done by adding the flags #SBATCH to the bash file.

rscript_opt

List. Options to be passed to Rscript.

seeds

Integer vector of length njobs. Seeds to be passed to each job. When NULL (default), seeds will be picked automatically (see new_rscript).

compress

Logical scalar (default TRUE). Passed to saveRDS. Setting this value to FALSE can be useful when the user requires faster read/write of R objects on disk.

export

A named list with objects to be included in the Spawned sessions.

export_env

An environment. Environment where the objects listed in export are located (default parent.frame()).

libPaths

A character vector. See .libPaths.

hooks

A list of functions (passed to new_slurm_job).

overwrite

Logical scalar. When TRUE, if the path specified by tmp_path/job_name already exists, it will overwrite it, otherwise the function returns with an error.

preamble

Character vector. Each element is then added to the Slurm batch file between the #SBATCH options and the script's main call. A common example is adding required modules, e.g. c("module load gcc/6.1.1").

Value

A list of length njobs.