run_tmb_on_slurm.RdCreates and optionally submits a SLURM job to run a TMB model on a computing cluster.
run_tmb_on_slurm(
data,
params,
random = NULL,
map_words = NULL,
dll = "model",
n_cores = NULL,
job_name = "TMBjob",
partition = "fuchs",
time = "8:00:00",
ntasks = 1,
nodes = 1,
conda_env = "kinh",
rscript = "run_tmb.r",
work_dir = ".",
submit = FALSE,
submit_cmd = "sbatch",
data_path = "tmb_data.RData",
param_path = "tmb_params.RData",
map_path = "tmb_param_map.RData"
)Data list for TMB model
Parameter list for TMB model
Character vector of random effect parameter names
Named list of parameter mapping specifications
Character name of compiled TMB model (without extension)
Number of cores for OpenMP parallelization
Character name for SLURM job
Character name of SLURM partition
Character time limit for job ("HH:MM:SS")
Number of tasks for SLURM
Number of nodes for SLURM
Character name of conda environment
Character name for generated R script
Character path to working directory
Logical whether to submit job immediately
Character command to submit SLURM job
Character path to save data
Character path to save parameters
Character path to save parameter map
Invisibly returns a list with:
Logical indicating if job was submitted
System output from job submission if applicable
Path to generated R script
Path to generated SLURM script
Path to saved data
Path to saved parameters
Path to saved parameter map if applicable
This function generates necessary R and SLURM scripts to run a TMB model on a SLURM-based computing cluster. It saves model data and parameters to files, creates an R script to fit the model, and a SLURM submission script. The job can be submitted immediately or the scripts can be saved for later submission.