R: Difference between revisions

Jump to navigation Jump to search
526 bytes added ,  7 years ago
→‎Running: include R script
(→‎Running: update after testing)
(→‎Running: include R script)
Line 116: Line 116:
====Running====
====Running====


Please your R code in a script file, in this case test.R.


Please your R code in a script file, in this case test.R.
#Tell all slaves to return a message identifying themselves.
  library("Rmpi")
  sprintf("TEST mpi.universe.size() =  %i", mpi.universe.size())
  ns <- mpi.universe.size() - 1
  sprintf("TEST attempt to spawn %i slaves", ns)
  mpi.spawn.Rslaves(nslaves=ns)
  mpi.remote.exec(paste("I am",mpi.comm.rank(),"of",mpi.comm.size()))
  mpi.remote.exec(paste(mpi.comm.get.parent()))
  #Send execution commands to the slaves
  x<-5
  #These would all be pretty correlated one would think
  x<-mpi.remote.exec(rnorm,x)
  length(x)
  x


Then place the following in a job submission script, job.sh :
Then place the following in a job submission script, job.sh :
cc_staff
239

edits

Navigation menu