Generates a remote configuration for launching daemons using an HPC cluster resource manager such as Slurm sbatch, SGE and Torque/PBS qsub or LSF bsub.
Arguments
- command
(character) cluster manager executable:
"sbatch"(Slurm),"qsub"(SGE/Torque/PBS), or"bsub"(LSF).- options
(character) script options for
command(e.g. "#SBATCH –mem=16G"), newline-separated. May include shell commands such as "module load R/4.5.0". Shebang line such as "#!/bin/bash" not required.- rscript
(character) Rscript executable. Use full path if needed, or
"Rscript.exe"on Windows.
Value
A list in the required format to be supplied to the remote argument
of daemons() or launch_remote().
See also
ssh_config() for SSH launch configurations, or remote_config()
for generic configurations.
Examples
# Slurm Config:
cluster_config(
command = "sbatch",
options = "#SBATCH --job-name=mirai
#SBATCH --mem=16G
#SBATCH --output=job.out
module load R/4.5.0",
rscript = file.path(R.home("bin"), "Rscript")
)
#> $command
#> [1] "/bin/sh"
#>
#> $args
#> [1] "sbatch<<'EOF'\n#!/bin/sh\n#SBATCH --job-name=mirai\n#SBATCH --mem=16G\n#SBATCH --output=job.out\nmodule load R/4.5.0\n"
#> [2] "."
#> [3] "\nEOF"
#>
#> $rscript
#> [1] "/opt/R/4.5.2/lib/R/bin/Rscript"
#>
#> $quote
#> NULL
#>
# SGE Config:
cluster_config(
command = "qsub",
options = "#$ -N mirai
#$ -l mem_free=16G
#$ -o job.out
module load R/4.5.0",
rscript = file.path(R.home("bin"), "Rscript")
)
#> $command
#> [1] "/bin/sh"
#>
#> $args
#> [1] "qsub<<'EOF'\n#!/bin/sh\n#$ -N mirai\n#$ -l mem_free=16G\n#$ -o job.out\nmodule load R/4.5.0\n"
#> [2] "."
#> [3] "\nEOF"
#>
#> $rscript
#> [1] "/opt/R/4.5.2/lib/R/bin/Rscript"
#>
#> $quote
#> NULL
#>
# Torque/PBS Config:
cluster_config(
command = "qsub",
options = "#PBS -N mirai
#PBS -l mem=16gb
#PBS -o job.out
module load R/4.5.0",
rscript = file.path(R.home("bin"), "Rscript")
)
#> $command
#> [1] "/bin/sh"
#>
#> $args
#> [1] "qsub<<'EOF'\n#!/bin/sh\n#PBS -N mirai\n#PBS -l mem=16gb\n#PBS -o job.out\nmodule load R/4.5.0\n"
#> [2] "."
#> [3] "\nEOF"
#>
#> $rscript
#> [1] "/opt/R/4.5.2/lib/R/bin/Rscript"
#>
#> $quote
#> NULL
#>
# LSF Config:
cluster_config(
command = "bsub",
options = "#BSUB -J mirai
#BSUB -M 16000
#BSUB -o job.out
module load R/4.5.0",
rscript = file.path(R.home("bin"), "Rscript")
)
#> $command
#> [1] "/bin/sh"
#>
#> $args
#> [1] "bsub<<'EOF'\n#!/bin/sh\n#BSUB -J mirai\n#BSUB -M 16000\n#BSUB -o job.out\nmodule load R/4.5.0\n"
#> [2] "."
#> [3] "\nEOF"
#>
#> $rscript
#> [1] "/opt/R/4.5.2/lib/R/bin/Rscript"
#>
#> $quote
#> NULL
#>
if (FALSE) { # \dontrun{
# Launch 2 daemons using the Slurm sbatch defaults:
daemons(n = 2, url = host_url(), remote = cluster_config())
} # }
