xcmsPapply(arg_sets, papply_action, papply_commondata = list(), show_errors = TRUE, do_trace = FALSE, also_trace = c())
Uses Rmpi to implement a pull idiom in order to distribute the processing evenly across a cluster. If Rmpi is not available, or there are no slaves, implements this as a non-parallel algorithm.
xcmsPapply
is a modified version of the papply function from package papply 0.2 (Duane Currie).
Parts of the slave function were wrapped in try() to make it failsafe and progress output was added.
Make sure Rmpi
was installed properly by executing the example below.
Rmpi
was tested with
MPI_ROOT
before installing Rmpi e.g. export MPI_ROOT=/usr/lib/openmpi
## Not run:
# library(Rmpi)
# library(xcms)
#
# number_lists <- list(1:10,4:40,2:27)
#
# mpi.spawn.Rslaves(nslaves=2)
#
# results <- xcmsPapply(number_lists,sum)
# results
#
# mpi.close.Rslaves()
#
# ## End(Not run)
Run the code above in your browser using DataLab