slurmArray: Wrapper for rslurm::slurm_apply

Description Usage Arguments Details Value See Also

View source: R/slurmArray.R

Description

Shorthand wrapper for submitting slurm job arrays using slurm_apply

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
slurmArray(
  f,
  params,
  jobname = NA,
  mem = 10000L,
  maxJobs = 500L,
  cpu = 1L,
  add_objects = NULL,
  pkgs = rev(.packages()),
  submit = TRUE,
  libPaths = NULL
)

Arguments

f

A function that accepts one or many single values as parameters and may return any type of R object.

params

A data frame of parameter values to apply f to. Each column corresponds to a parameter of f (Note: names must match) and each row corresponds to a separate function call.

jobname

The name of the Slurm job; if NA, it is assigned a random name of the form "slr####".

mem

integer of length 1, how much memory to allocate to each job in bytes

maxJobs

integer of length 1, what is the maximum jobs to run at one time?

cpu

integer of length 1, how many cores for each job?

add_objects

A character vector containing the name of R objects to be saved in a .RData file and loaded on each cluster node prior to calling f.

pkgs

A character vector containing the names of packages that must be loaded on each cluster node. By default, it includes all packages loaded by the user when slurm_apply is called.

submit

Whether or not to submit the job to the cluster with sbatch; see Details below for more information.

libPaths

A character vector describing the location of additional R library trees to search through, or NULL. The default value of NULL corresponds to libraries returned by .libPaths() on a cluster node. Non-existent library trees are silently ignored.

Details

Submits a slurm array with a job for each row in params. See slurm_apply for more details.

Value

A slurm_job object containing the jobname and the number of nodes effectively used.

See Also

slurm_apply


daynefiler/dlfUtils documentation built on Oct. 22, 2021, 9:49 a.m.