Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slaves are spawned successfully but on single node only. #3

Open
sunracesuraj opened this issue Jul 3, 2019 · 0 comments
Open

slaves are spawned successfully but on single node only. #3

sunracesuraj opened this issue Jul 3, 2019 · 0 comments

Comments

@sunracesuraj
Copy link

sunracesuraj commented Jul 3, 2019

Hello,

I came across a post - http://borisv.lk.net/howtos/grid-mpi-r-howto.html
I have managed to get R running on Rocks 7 and now I am stuck at following stage - did anyone face this problem? If yes then did anyone ever solve it?

Basically only one host is being used to spawn the slaves.

I get this result for the given code.

Code - 1

detectCores.R script

library(Rmpi)
library('parallel')
cl <- makeCluster(2,type="MPI")
clusterCall(cl, function() Sys.info()[c("nodename","machine")])
stopCluster(cl)
mpi.quit()

Result -
[root@front rolltests]# Rscript detectCores.R
2 slaves are spawned successfully. 0 failed.
[[1]]
nodename machine
"front.attr1.kw" "x86_64"

[[2]]
nodename machine
"front.attr1.kw" "x86_64"

Code 2
detectCores.R script
library(Rmpi)
library('parallel')
n.cores <- mpi.universe.size()
cl <- makeCluster(n.cores, type='MPI')
result <- parLapply(cl, 1:n.cores,
function (i) {system2('hostname', stdout=TRUE)})
summary(factor(unlist(result)))
stopCluster(cl)
mpi.quit()

Result -
[root@front rolltests]# Rscript detectCores.R
1 slaves are spawned successfully. 0 failed.
front.attr1.kw
1

I also came across this post - is this related?

https://stackoverflow.com/questions/30470443/initialize-mpi-cluster-using-rmpi

It will be great help if someone could guide me in the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant