Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

clusterApply

Apply operations using clusters


Description

These functions provide several ways to parallelize computations using a cluster.

NOTE: This man page is for the clusterCall, clusterApply, clusterApplyLB, clusterEvalQ, clusterExport, clusterMap, clusterSplit, parLapply, parSapply, parApply, parRapply, parCapply, parLapplyLB, and parSapplyLB S4 generic functions defined in the BiocGenerics package. See ?parallel::clusterApply for the default methods (defined in the parallel package). Bioconductor packages can define specific methods for cluster-like objects not supported by the default methods.

Usage

clusterCall(cl=NULL, fun, ...)
clusterApply(cl=NULL, x, fun, ...)
clusterApplyLB(cl=NULL, x, fun, ...)
clusterEvalQ(cl=NULL, expr)
clusterExport(cl=NULL, varlist, envir=.GlobalEnv)
clusterMap(cl=NULL, fun, ..., MoreArgs=NULL, RECYCLE=TRUE,
           SIMPLIFY=FALSE, USE.NAMES=TRUE,
           .scheduling=c("static", "dynamic"))
clusterSplit(cl=NULL, seq)

parLapply(cl=NULL, X, fun, ..., chunk.size=NULL)
parSapply(cl=NULL, X, FUN, ..., simplify=TRUE,
          USE.NAMES=TRUE, chunk.size=NULL)
parApply(cl=NULL, X, MARGIN, FUN, ..., chunk.size=NULL)
parRapply(cl=NULL, x, FUN, ..., chunk.size=NULL)
parCapply(cl=NULL, x, FUN, ..., chunk.size=NULL)

parLapplyLB(cl=NULL, X, fun, ..., chunk.size=NULL)
parSapplyLB(cl=NULL, X, FUN, ..., simplify=TRUE,
            USE.NAMES=TRUE, chunk.size=NULL)

Arguments

cl

A cluster-like object.

x

A vector-like object for clusterApply and clusterApplyLB. A matrix-like object for parRapply and parCapply.

seq

Vector-like object to split.

X

A vector-like object for parLapply, parSapply, parLapplyLB, and parSapplyLB. An array-like object for parApply.

fun, ..., expr, varlist, envir, MoreArgs, RECYCLE, SIMPLIFY, USE.NAMES, .scheduling, chunk.size, FUN, simplify, MARGIN

See ?parallel::clusterApply for a description of these arguments.

Value

See ?parallel::clusterApply for the value returned by the default methods.

Specific methods defined in Bioconductor packages should behave like the default methods.

See Also

  • parallel::clusterApply for the default methods.

  • showMethods for displaying a summary of the methods defined for a given generic function.

  • selectMethod for getting the definition of a specific method.

  • BiocGenerics for a summary of all the generics defined in the BiocGenerics package.

Examples

clusterCall  # note the dispatch on the 'cl' arg only
showMethods("clusterCall")
selectMethod("clusterCall", "ANY")  # the default method

clusterApply  # note the dispatch on the 'cl' and 'x' args only
showMethods("clusterApply")
selectMethod("clusterApply", c("ANY", "ANY"))  # the default method

clusterApplyLB  # note the dispatch on the 'cl' and 'x' args only
showMethods("clusterApplyLB")
selectMethod("clusterApplyLB", c("ANY", "ANY"))  # the default method

clusterEvalQ  # note the dispatch on the 'cl' arg only
showMethods("clusterEvalQ")
selectMethod("clusterEvalQ", "ANY")  # the default method

clusterExport  # note the dispatch on the 'cl' arg only
showMethods("clusterExport")
selectMethod("clusterExport", "ANY")  # the default method

clusterMap  # note the dispatch on the 'cl' arg only
showMethods("clusterMap")
selectMethod("clusterMap", "ANY")  # the default method

clusterSplit
showMethods("clusterSplit")
selectMethod("clusterSplit", c("ANY", "ANY"))  # the default method

parLapply  # note the dispatch on the 'cl' and 'X' args only
showMethods("parLapply")
selectMethod("parLapply", c("ANY", "ANY"))  # the default method

parSapply  # note the dispatch on the 'cl' and 'X' args only
showMethods("parSapply")
selectMethod("parSapply", c("ANY", "ANY"))  # the default method

parApply  # note the dispatch on the 'cl' and 'X' args only
showMethods("parApply")
selectMethod("parApply", c("ANY", "ANY"))  # the default method

parRapply  # note the dispatch on the 'cl' and 'x' args only
showMethods("parRapply")
selectMethod("parRapply", c("ANY", "ANY"))  # the default method

parCapply  # note the dispatch on the 'cl' and 'x' args only
showMethods("parCapply")
selectMethod("parCapply", c("ANY", "ANY"))  # the default method

parLapplyLB  # note the dispatch on the 'cl' and 'X' args only
showMethods("parLapplyLB")
selectMethod("parLapplyLB", c("ANY", "ANY"))  # the default method

parSapplyLB  # note the dispatch on the 'cl' and 'X' args only
showMethods("parSapplyLB")
selectMethod("parSapplyLB", c("ANY", "ANY"))  # the default method

BiocGenerics

S4 generic functions used in Bioconductor

v0.36.1
Artistic-2.0
Authors
The Bioconductor Dev Team
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.