View source: R/sbatch_master.R
sbatch_master | R Documentation |
Creates a master-level SLURM::sbatch script given a set of parameter combinations implied by environmental arguments used as parameters.
sbatch_master(
vars,
expand.vars = TRUE,
working.dir = "",
master.file = "",
runsim.file = "runsim.sh",
build.runsim = FALSE,
env.file = "~/loadR.sh",
rscript.file = "sim.R",
param.file = NULL,
param.tag = NULL,
simno.start,
nsims = 100,
ncores = 16,
narray = NULL,
ckpt = FALSE,
append = FALSE,
mem = "55G",
walltime = "1:00:00",
jobname,
partition.main = "csde",
partition.ckpt = "ckpt",
account.main = "csde",
account.ckpt = "csde-ckpt"
)
vars |
A list of parameters with varying values (see examples below). |
expand.vars |
If |
working.dir |
Path to write out the |
master.file |
Name of the output bash shell script file to write. If
|
runsim.file |
Name of the bash shell script file that contains the R batch
commands to be executed by |
build.runsim |
If |
env.file |
Bash shell script to load the R environment desired. Optionally kept in a user's home directory with the default file name. Example script below. |
rscript.file |
Name of the |
param.file |
Name of a csv file to write out the list of varying parameters and simulation numbers set within the function. |
param.tag |
Character string for current scenario batch added to param.sheet. |
simno.start |
Starting number for the |
nsims |
Total number of simulations across all array jobs. |
ncores |
Number of cores per node to use within each Slurm job. |
narray |
Number of array batches within each Slurm job. If |
ckpt |
If |
append |
If |
mem |
Amount of memory needed per node within each Slurm job. |
walltime |
Amount of clock time needed per Slurm job. |
jobname |
Job name assigned to Slurm job. If unspecified, defaults to the simulation number in each job. |
partition.main |
Name of primary HPC partition (passed to -p). |
partition.ckpt |
Name of checkpoint HPC partition (passed to -p). |
account.main |
Name of primary account (passed to -A). |
account.ckpt |
Name of checkpoint account (passed to -A). |
# Examples printing to console
vars <- list(A = 1:5, B = seq(0.5, 1.5, 0.5))
sbatch_master(vars)
sbatch_master(vars, nsims = 250)
sbatch_master(vars, ckpt = TRUE)
sbatch_master(vars, nsims = 50, ckpt = 10)
sbatch_master(vars, simno.start = 1000)
sbatch_master(vars, jobname = "epiSim")
## Not run:
# Full-scale example writing out files
sbatch_master(vars, nsims = 50, simno.start = 1000, build.runsim = TRUE,
master.file = "master.sh", param.sheet = "params.csv")
sbatch_master(vars, nsims = 50, append = TRUE,
master.file = "master.sh", param.sheet = "params.csv")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.