# use Rhpc command
Rhpc_initialize()
cl <- Rhpc_getHandle() # ommit number of worker if use Rhpc batch
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