Skip to contents

A simplified wrapper for submitting parameter sweeps to HPC clusters. Automatically selects the appropriate parallelization strategy based on the specified cluster type.

Usage

submit_hpc_sweep(
  cluster_type = c("local", "pbs", "slurm", "sge"),
  queue = NULL,
  walltime = "04:00:00",
  memory = NULL,
  test = FALSE,
  cores = 4,
  output_dir = NULL,
  submit = TRUE,
  verbose = TRUE
)

Arguments

cluster_type

Character. Type of HPC cluster:

  • "local": Local multicore execution (no HPC)

  • "pbs": PBS/OpenPBS/TORQUE cluster

  • "slurm": SLURM cluster

  • "sge": SGE cluster

queue

Character. Queue/partition name for the cluster. Required for HPC clusters.

walltime

Character. Maximum wall time per job (default: "04:00:00").

memory

Character. Memory per job (default: "4gb" for PBS, "4096" for SLURM).

test

Logical. If TRUE, use test parameter grid. Default is FALSE.

cores

Integer. Number of cores for local execution. Default is 4.

output_dir

Character. Output directory for results.

submit

Logical. If TRUE, submit jobs. If FALSE, just generate scripts. Default is TRUE.

verbose

Logical. Print progress messages. Default is TRUE.

Value

Invisibly returns the result from run_param_sweep_modelsel.

Details

This function provides a simplified interface for the most common HPC use cases. It automatically:

  • Selects the appropriate future backend for the cluster type

  • Configures resource specifications

  • Handles PBS vs SLURM differences

For more control over the submission, use run_param_sweep_modelsel directly with parallel_strategy = "future" or "pbs".

Examples

if (FALSE) { # \dontrun{
# Local execution (8 cores)
submit_hpc_sweep("local", cores = 8, test = TRUE)

# PBS cluster
submit_hpc_sweep("pbs", queue = "batch", walltime = "02:00:00")

# SLURM cluster
submit_hpc_sweep("slurm", queue = "compute", memory = "8192")

# Dry run (generate scripts without submitting)
submit_hpc_sweep("pbs", queue = "batch", submit = FALSE)
} # }