multicore.setup | R Documentation |
A set of wrapper functions for multicore processing, using the
parallel
package.
multicore.setup(max.cores = NULL)
multicore.currentCoreCount()
multicore.totalCoreCount()
multicore.samplePairs(sampleSet, symmetric.pairs = FALSE)
multicore.tapply(x, INDEX, FUN, ...)
multicore.lapply(x, FUN, ...)
multicore.by(data, INDICES, FUN, ...)
max.cores |
integer specifying how many cores to request. |
sampleSet |
character vector (or list of character vectors), usually SampleIDs, that
need to be turned into a list of all pairs from |
symmetric.pairs |
logical, are symmetric pairs needed. This is for cases where the function to be
called is sensitive to the order of its 2 arguments (i.e.
|
x , INDEX , FUN , ... |
the usual arguments passed on to the respective 'apply' function |
data , INDICES , FUN , ... |
the usual arguments passed on to the 'by' function |
These are simple wrappers around the parallel
routines, to facilitate
parcelling computations that involve entire chromosomes or samples out to
separate cores.
For multicore.setup
, the maximum of the number of cores actually available
or the number of cores requested. The function
tries to load package parallel
, and if successful, sets the number of
cores to be used. This value can be subsequently returned by multicore.currentCoreCount
.
For multicore.currentCoreCount
, integer telling the number of cores currently
requested via multicore.setup
.
For multicore.totalCoreCount
, integer telling the number of cores actually
present on this compute node. If multicore.setup
has not yet been called, it
does so and requests all cores available.
For multicore.samplePairs
, a list of vectors (each of length 2), suitable for
a call to multicore.lapply
for a function expecting a vector of length 2 as its
argument.
For multicore.tapply
and multicore.lapply
, the same type result as their
primitive functions, after being gathered from the separate cores.
All multicore functions turn off prescheduling ( mc.preschedule=FALSE
), because
we assume the processing time of each piece is highly variable.
All multicore functions turn off recursion ( mc.allow.recursive=FALSE
), because
we assume all available cores will be used by the parent call.
multicore.samplePairs( list( c("Tom", "Dick", "Harry"), c("Jack","Jill")), symmetric.pairs=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.