Skip to content

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

@sunracesuraj

Description

@sunracesuraj

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions