Can't replace doMPI with doFuture #536
-
Hello, I am trying to migrate some code from using doMPI to using doFuture. Following from the example there, I translate my doMPI code: library(Rmpi)
library(doMPI)
library(foreach)
cl <- doMPI::startMPIcluster(mpi.comm.size(0) - 1)
registerDoMPI(cl)
# Code here to doFuture as: library(parallelly)
library(Rmpi)
library(doFuture)
registerDoFuture()
cl <- parallel::makeCluster(mpi.comm.size(0) - 1, type = "MPI")
plan(cluster, workers = cl)
# Code here The doMPI code works perfectly, but the doFuture code will not run and produces these errors:
Then it repeats
48 times. Note that this is running on 64 CPU's across 4 nodes, so I'm not sure why there are 48 repetitions of this error. Then this error, which seems to know about the 64:
I'm not sure if this is a bug, or if I am doing something wrong. Any help would be appreciated. Thanks, Damon |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Thanks for reporting. I've found MPI to be very picky and sensitive to the local setup. It's not unlikely that doMPI got more love than the MPI backend from parallel w/ Rmpi over the years, and therefore works better in more cases. Having said that, let's leave out the future framework for now, and see if even the following works for you: library(parallel)
cl <- parallel::makeCluster(2L, type="MPI")
info <- parLapply(cl, X=seq_along(cl), fun=function(i) {
data.frame(i=i, pid=Sys.getpid())
})
info <- do.call(rbind, info)
print(info) Also, what's your |
Beta Was this translation helpful? Give feedback.
Thanks for reporting. I've found MPI to be very picky and sensitive to the local setup. It's not unlikely that doMPI got more love than the MPI backend from parallel w/ Rmpi over the years, and therefore works better in more cases.
Having said that, let's leave out the future framework for now, and see if even the following works for you:
Also, what's your
sessionInfo()
after loading all packages of interest.