You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having an issue with future.batchtools that I've been unable to resolve: batchtools::submitJobs fails when called from future.batchtools, but not when called from batchtools. I believe it may be a problem with how future.batchtools handles the config file, but I'm not sure.
Running with batchtools works as expected. R loads my batchtools temp file and configuration file.
Running using future.batchtools fails to submit jobs.
Project '/scratch/Renaldi/TEST' loaded. [renv 0.15.5]
> library(future)
> library(future.batchtools)
Loading required package: parallelly
> piApprox = function(n) {
nums = matrix(runif(2 * n), ncol = 2)
d = sqrt(nums[, 1]^2 + nums[, 2]^2)
4 * mean(d <= 1)
}
> plan(tweak(
batchtools_slurm,
resources = list(
walltime = 60,
ntasks = 1,
ncpus = 1,
memory = 1024
)
))
> results <- list()
> for(i in 1:10){results[[i]] <- future::future(piApprox(1e5))}
Error: Failed to submit BatchtoolsSlurmFuture (<none>). The reason was: Listing of jobs failed (exit code 127);
cmd: 'squeue --user=$USER --states=R,S,CG --noheader --format=%i -r'
output:
command not found
TROUBLESHOOTING INFORMATION:
batchtools::submitJobs() was called with the following 'resources' argument:
List of 4
$ walltime: num 60
$ ntasks : num 1
$ ncpus : num 1
$ memory : num 1024
batchtools.slurm.tmpl:
#!/bin/bash
## Job Resource Interface Definition
##
## ntasks [integer(1)]: Number of required tasks,
## Set larger than 1 if you want to further parallelize
## with MPI within your job.
## ncpus [integer(1)]: Number of required cpus per task,
## Set larger than 1 if you want to further parallelize
## with multicore/parallel within each task.
## walltime [integer(1)]: Walltime for this job, in seconds.
## Must be at least 60 seconds for Slurm to work properly.
## memory [integer(1)]: Memory in megabytes for each cpu.
## Must be at least 100 (when I tried lower values my
## jobs did not start at all).
##
## Default resources can be set in your .batchtools.conf.R by defining the variable
## 'default.resources' as a named list.
<%
# relative paths are not handled well by Slurm
log.file = fs::path_expand(log.file)
-%>
#SBATCH --job-name=<%= job.name %>
#SBATCH --output=<%= log.file %>
#SBATCH --error=<%= log.file %>
#SBATCH --time=<%= ceiling(resources$walltime / 60) %>
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=<%= resources$ncpus %>
#SBATCH --mem-per-cpu=<%= resources$memory %>
<%= if (!is.null(resources$partition)) sprintf(paste0("#SBATCH --partition='", resources$partition, "'")) %>
<%= if (array.jobs) sprintf("#SBATCH --array=1-%i", nrow(jobs)) else "" %>
## Initialize work environment like
## source /etc/profile
## module add ...
module purge
module load r/gcc/4.2.0
## Export value of DEBUGME environemnt var to slave
export DEBUGME=<%= Sys.getenv("DEBUGME") %>
<%= sprintf("export OMP_NUM_THREADS=%i", resources$omp.threads) -%>
<%= sprintf("export OPENBLAS_NUM_THREADS=%i", resources$blas.threads) -%>
<%= sprintf("export MKL_NUM_THREADS=%i", resources$blas.threads) -%>
## Run R:
## we merge R output with stdout from SLURM, which gets then logged via --output option
Rscript -e 'batchtools::doJobCollection("<%= uri %>")'
batchtools.conf.R
Note: The HPC login node is named "log-3"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello All,
I'm having an issue with future.batchtools that I've been unable to resolve: batchtools::submitJobs fails when called from future.batchtools, but not when called from batchtools. I believe it may be a problem with how future.batchtools handles the config file, but I'm not sure.
Running with batchtools works as expected. R loads my batchtools temp file and configuration file.
Running using future.batchtools fails to submit jobs.
batchtools.slurm.tmpl:
batchtools.conf.R
Note: The HPC login node is named "log-3"
Beta Was this translation helpful? Give feedback.
All reactions