This function prepares and writes SLURM file(s) for submitting model fitting jobs on an HPC environment. It dynamically generates bash scripts based on the provided parameters, which are then used to submit jobs to the SLURM workload manager.
Usage
Mod_SLURM(
ModelDir = NULL,
JobName = NULL,
CatJobInfo = TRUE,
ntasks = 1L,
CpusPerTask = 1L,
GpusPerNode = 1L,
MemPerCpu = NULL,
Time = NULL,
Partition = "small-g",
EnvFile = ".env",
FromHPC = TRUE,
Path_Hmsc = NULL,
Command_Prefix = "Commands2Fit",
SLURM_Prefix = "Bash_Fit",
Path_SLURM_Out = NULL
)
Arguments
- ModelDir
String. Path to the model files (without trailing slash).
- JobName
String. The name of the submitted job(s).
- CatJobInfo
Logical. Add bash lines to print information on the submitted job. Default:
TRUE
.- ntasks
Integer. The value for the
#SBATCH --ntasks=
SLURM argument. Default: 1.- CpusPerTask
Integer. The value for the
#SBATCH --cpus-per-task=
SLURM argument. Default: 1.- GpusPerNode
Integer. The value for the
#SBATCH --gpus-per-node=
SLURM argument. Default: 1.- MemPerCpu
String. Memory per CPU allocation for the SLURM job. Example:
32G
for 32 gigabytes. Defaults toNULL
. If not provided, the function will throw an error.- Time
String. Duration for which the job should run. Example:
01:00:00
for one hour. If not provided, the function will throw an error.- Partition
String. The name of the partition. Default:
small-g
for running the array jobs on the GPU.- EnvFile
String. Path to read the environment variables. Default value:
.env
.- FromHPC
Logical. Indicates if the operation is being performed from an HPC environment. This adjusts file paths accordingly. Default:
TRUE
.- Path_Hmsc
String. Path for the Hmsc-HPC.
- Command_Prefix
String. Prefix for the bash commands to be executed. Default:
Commands2Fit
.- SLURM_Prefix
String. Prefix for the exported SLURM file.
- Path_SLURM_Out
String indicating the directory where the SLURM file(s) will be saved. Defaults to
NULL
, which means to identify the path fromModelDir
.