Description Usage Arguments Details Author(s) Examples
Rhpc_lapply, Rhpc_lapplyLB and Rhpc_worker_call using MPI provides better HPC environment on R(works fast on HPC). and this package supports long vector, can deal with slightly big data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Rhpc_initialize()
Rhpc_finalize()
Rhpc_getHandle(procs)
Rhpc_worker_call(cl, FUN, ..., usequote)
Rhpc_worker_noback(cl, FUN, ..., usequote)
Rhpc_lapply(cl, X, FUN, ...,usequote)
Rhpc_lapplyLB(cl, X, FUN, ..., usequote)
Rhpc_sapply(cl, X, FUN, ..., usequote, simplify, USE.NAMES)
Rhpc_sapplyLB(cl, X, FUN, ..., usequote, simplify, USE.NAMES)
Rhpc_apply(cl, X, MARGIN, FUN, ..., usequote)
Rhpc_numberOfWorker(cl)
Rhpc_Export(cl, variableNames, usequote, pos, envir)
Rhpc_EvalQ(cl, expr, usequote, envir)
Rhpc_setupRNG(cl, iseed)
|
cl |
external pointer to MPI communicator |
procs |
Specify the number of processes when performing dynamic process generation (use the MPI_Comm_spawn), only static generate if blank |
X |
vector or list. Divided into smaller vectors according to the number of workers, and distributed to workers when the function is first executed. One-sided communication is used asynchronously |
FUN |
string of function name or function object. Function name or string (string expresses function name) Distributed by collective communication at first, then they are not sent again |
MARGIN |
a vector giving the subscripts which the function will
be applied over. E.g., for a matrix |
simplify |
logical or character string; should the result be
simplified to a vector, matrix or higher dimensional array if
possible? For |
USE.NAMES |
logical; if |
... |
arguments. Distributed by collective communication at first, then they are not sent again |
usequote |
user can choose usequpte=FALSE for performance improvement |
variableNames |
string vector |
iseed |
random number seed |
expr |
expression to evaluate |
pos |
default is current environment position |
envir |
where to look for the object |
Rhpc batch wrapper in package directory if you use mpirun.
This package sets "Rhpc.mpi.c.comm"
,"Rhpc.mpi.f.comm"
,
"Rhpc.mpi.rank"
and "Rhpc.mpi.procs"
can get attribute of MPI in getOption().
https://prs.ism.ac.jp/~nakama/Rhpc/
Junji NAKANO <nakanoj@ism.ac.jp> and Ei-ji Nakama<nakama@com-one.com>
Maintainer: Ei-ji Nakama <nakama@com-one.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ## Not run:
# use Rhpc command
Rhpc_initialize()
# If you start the process dynamically on Windows, the dos window of
# mpiexec will be created, but you should not close this window.
cl <- Rhpc_getHandle(5) # 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_sapply(cl,1:10000,sqrt)
Rhpc_sapplyLB(cl,1:10000,sqrt)
df<-data.frame(a=1:4,b=5:8)
Rhpc_apply(cl,df,1,max)
Rhpc_apply(cl,df,2,max)
Rhpc_finalize()
#
# command line example
#
# mpirun -n 4 Rhpc CMD BATCH --no-save `script file for exemplified above'
#
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.