# use Rhpc command
Rhpc_initialize()
cl <- Rhpc_getHandle() # ommit number of worker if use Rhpc batch
# Rhpc set to options
opstr=list("Rhpc.mpi.rank","Rhpc.mpi.procs","Rhpc.mpi.c.comm","Rhpc.mpi.f.comm")
do.call("options",opstr)
Rhpc_worker_call(cl, "do.call","options", opstr)
# warning! : pointer not export, worker Rhpc.mpi.c.comm is (nil) on master.
Rhpc_worker_call(cl, Sys.getpid)
Rhpc_lapply(cl,1:10000,sqrt)
Rhpc_lapplyLB(cl,1:10000,sqrt)
Rhpc_finalize()
#
# command line example
#
# mpirun -n 4 Rhpc CMD BATCH --no-save `script file for exemplified above'
#Run the code above in your browser using DataLab