mllg / batchtools

Tools for computation on batch systems
https://mllg.github.io/batchtools/
GNU Lesser General Public License v3.0
170 stars 51 forks source link

Problem with btlapply #241

Closed kokyriakidis closed 4 years ago

kokyriakidis commented 4 years ago

When I try to run the code above it works ok:

module load nixpkgs/16.09 gcc/7.3.0  r/3.6.0

R

library(devtools)

install_github("mllg/batchtools")

library(batchtools)

## To start again from scratch, manually remove the 'test' folder.
reg <- makeRegistry('test', seed=123)
## reg = loadRegistry('test', writeable=TRUE) ## If the registry has already been created before

test.f <- function(ii){
    return(mean(rnorm(10,ii)))
}

batchMap(reg=reg, test.f, 1:2)
submitJobs(reg=reg, ids=findJobs(reg=reg), resources=list(walltime='10:00', cores=1))
waitForJobs(reg=reg, sleep=10)
getStatus(reg=reg)
reduceResultsList(reg=reg)

When I try to run the code below I get this error:

> reg <- makeRegistry('test', seed=123)
Sourcing configuration file '/tmp/RtmpTSImYC/batchtools.conf.R' ...
Created registry in '/scratch/kyriakid/test' using cluster functions 'Slurm'
> test.f <- function(ii){
+ return(mean(rnorm(10,ii)))
+ }
> btlapply(1:2, test.f, resources=list(walltime='10:00', cores=1), reg=reg)
Adding 2 jobs ...
Submitting 2 jobs in 2 chunks using cluster functions 'Slurm' ...
Error in .reduceResultsList(ids, fun, ..., missing.val = missing.val,  :      
  All jobs must be have been successfully computed

@mllg any thoughts?

mllg commented 4 years ago

A wild guess: /tmp and /scratch or not shared across computational nodes, you need to create the registry inside your home directory. Also, I'm unsure why your config file is located in /tmp/RtmpTSImYC/batchtools.conf.R ?

What does getErrorMessages(reg) return?

kokyriakidis commented 4 years ago

Ok I fixed it! It was a write permission issue!

Don’t worry about the config. I put it there for specific reasons!

Thanks!