fork download
  1.  
  2. #include <mpi.h>
  3. library(Rmpi)
  4. mpi.spawn.Rslaves(needlog = FALSE)
  5.  
  6. mpi.bcast.cmd( id <- mpi.comm.rank() )
  7. mpi.bcast.cmd( np <- mpi.comm.size() )
  8. mpi.bcast.cmd( host <- mpi.get.processor.name() )
  9. result <- mpi.remote.exec(paste("I am", id, "of", np, "running on", host))
  10.  
  11. print(unlist(result))
  12.  
  13. mpi.close.Rslaves(dellog = FALSE)
  14. mpi.exit()
  15.  
  16.  
Success #stdin #stdout #stderr 0.25s 40512KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error in library(Rmpi) : there is no package called ‘Rmpi’
Execution halted