(Load balancing) parallellapply
and related functions.
mpi.iapplyLB(X, FUN, ..., apply.seq=NULL, comm=1, sleep=0.01)
mpi.iparApply(X, MARGIN, FUN, ..., job.num = mpi.comm.size(comm)-1,
apply.seq=NULL, comm=1, sleep=0.01)
mpi.iparLapply(X, FUN, ..., job.num=mpi.comm.size(comm)-1, apply.seq=NULL,
comm=1,sleep=0.01)
mpi.iparSapply(X, FUN, ..., job.num=mpi.comm.size(comm)-1, apply.seq=NULL,
simplify=TRUE, USE.NAMES = TRUE, comm=1, sleep=0.01)
mpi.iparRapply(X, FUN, ..., job.num=mpi.comm.size(comm)-1, apply.seq=NULL,
comm=1, sleep=0.01)
mpi.iparCapply(X, FUN, ..., job.num=mpi.comm.size(comm)-1, apply.seq=NULL,
comm=1,sleep=0.01)
mpi.iparReplicate(n, expr, job.num=mpi.comm.size(comm)-1, apply.seq=NULL,
simplify = TRUE, comm=1,sleep=0.01)
mpi.iparMM(A, B, comm=1, sleep=0.01)
an array or matrix.
vector specifying the dimensions to use.
a function.
logical; should the result be simplified to a vector or matrix if possible?
logical; if TRUE
and if X
is character, use X
as
names
for the result unless it had names already.
number of replications.
a matrix
a matrix
expression to evaluate repeatedly.
Total job numbers. If job numbers is bigger than total slave numbers (default value), a load balancing approach is used.
if reproducing the same computation (simulation) is desirable, set it to the integer vector .mpi.applyLB generated in previous computation (simulation).
optional arguments to Fun
a communicator number
a sleep interval on master node (in sec)
mpi.iparApply
, mpi.iparLapply
, mpi.iparSapply
, mpi.iparRapply
,
mpi.iparCapply
, mpi.iparSapply
, mi.iparReplicate
, and mpi.iparMM
are nonblocking versions of mpi.parApply
, mpi.parLapply
, mpi.parSapply
,
mpi.parRapply
, mpi.parCapply
, mpi.parSapply
, mpi.parReplicate
,
and mpi.parMM
respectively. The main difference is that mpi.iprobe
and
Sys.sleep
are used so that master node consumes almost no CPU cycles while waiting for
slaves results. However, due to frequent wake/sleep cycles on master, those functions are not
suitable for running small jobs on slave nodes. If anticipated computing time for each job is
relatively long, e.g., minutes or hours, setting sleep to be 1 second or longer will further
reduce load on master (only slightly).
mpi.iapply