Closed
Description
The following code does not work with clustermq. It worked with R 3.5.3 and it works in sequential mode. It also works with doParallel but not with clustermq. I tested with multisession and SLURM backends. Both gave me an error:
Error in summarize_result(job_result, n_errors, n_warnings, cond_msgs, :
5/5 jobs failed (0 warnings). Stopping.
(Error #1) no applicable method for 'f' applied to an object of class "c('integer', 'numeric')"
library(future)
library(foreach)
library(clustermq)
f <- function(i) {
UseMethod('f')
}
f.numeric <- function(i) {
Sys.sleep(10)
sqrt(i)
}
# It does not do anything
if(getRversion() >= "3.6.0") {
.S3method('f', 'numeric', 'f.numeric')
}
ncores <- 12
memory <- 1024
options(clustermq.scheduler="multiprocess")
register_dopar_cmq(n_jobs=ncores, memory=memory)
# registerDoSEQ()
res <- foreach(i=1:ncores) %dopar% { f(i) }
Activity