sfPar

Share:

Description

Executing a list of functions distributed via sfApply.

Usage

1
sfPar(fList, sfParParallel = TRUE, sfParArgsList = NULL, ...)

Arguments

fList

the list of functions

sfParParallel

if FALSE, then apply is used instead of sfClusterApplyLB - good for debugging

sfParArgsList

an optional list of arguments passed to each function

...

passed to each function

Details

If argsList is a name it is evaluated on the node before calling the function this allows to distribute variables by sfExport before rather than transferring them with each call which is advantages when the call is issued very often and the arguments are large

Value

a list of returns for each function

Author(s)

Thomas Wutzler

See Also

twSnowfall

Examples

1
2
3
4
5
6
7
#sfInit(parallel=TRUE,cpus=4)
fList <- list(
	function(...){ "Hello world!" } # dots are important
	,function(a){ a }
)
# each function is executed on a different node
(res <- sfPar( fList, sfParArgsList=list(a="aha") ))