library(doMPI)
cl <- startMPIcluster()
registerDoMPI(cl)
… use of foreach and %dopar% …
closeCluster(cl)
mpi.quit()
在一个cluster上运行(cmd方式)
mpirun -np 4 R --slave -f myscript.R(可在单机模拟运行)
或者
mpirun -H localhost,n2,n3 R --slave -f myscript.R
library(doMPI)
cl <- startMPIcluster()
registerDoMPI(cl)
… use of foreach and %dopar% …
closeCluster(cl)
mpi.quit()
在一个cluster上运行(cmd方式)
mpirun -np 4 R --slave -f myscript.R(可在单机模拟运行)
或者
mpirun -H localhost,n2,n3 R --slave -f myscript.R