Convenience wrapper around mirai::daemons() that launches
Slurm-backed daemons with resource settings specified in R-friendly units.
Usage
mirai_start_daemons(
n = 1,
partition = "c8a-4xlarge",
nodes = 1,
cpu_count = NULL,
mem_gb = NULL,
options = character(),
time_minutes = NULL,
job_name = mirai_job_name(),
...
)Arguments
- n
Number of daemons (Slurm workers) to launch.
- partition
Slurm partition name (e.g.
"c8a-4xlarge").- nodes
Target number of nodes to spread daemons across when calculating default CPU and memory per daemon.
- cpu_count
Number of CPUs per task (
#SBATCH --cpus-per-task).- mem_gb
Memory per task in gigabytes (
#SBATCH --mem).- options
Optional named character vector of additional Slurm options. Names are option keys (with or without the
--prefix), values are option values. For flag options, use an empty string ("") as the value.- time_minutes
Optional walltime limit in minutes. If
NULL, no#SBATCH --timeoption is set and Slurm defaults are used. If numeric, it is converted toHH:MM:SS.- job_name
Slurm job name. Defaults to
"mirai-<user>".- ...
Additional arguments passed to
mirai::daemons().
Value
The value returned by mirai::daemons().
Details
After launching daemons, check active connections with
mirai::info() and mirai::status(). To shut down all daemons started for
the current session, run mirai::daemons(0).
Examples
if (FALSE) { # \dontrun{
mirai_start_daemons(2)
mirai_ls_daemons()
mirai_stop_daemons()
} # }