snowfall-package | R Documentation |
snowfall is designed to make setup and usage of snow more
easier. It also is made ready to work together with sfCluster
,
a ressource management and runtime observation tool for
R-cluster usage.
Package: | snowfall |
Type: | Package |
Version: | 1.61 |
Date: | 2008-11-01 |
License: | GPL |
Initalisation via sfInit
must be called
before the usage
of any of the snowfall internal functions. sfStop
stopps
the current cluster. Some additional functions give access to build-in
functions (like sfParallel
, sfCpus
etc.).
The are plenty of function to execute parallel
calculations via snowfall. Most of them are wrappers to the
according snow functions, but there are additional functions as
well. Most likely the parallel versions of the R-buildin applies are
interesting: sfLapply
, sfSapply
and sfApply
. For
better cluster take a look at the load balanced
sfClusterApplyLB
and the function with restore possibilities:
sfClusterApplySR
.
Various tools allow an easier access to parallel
computing: sfLibrary
and sfSource
for loading code on
the cluster, sfExport
, sfExportAll
, sfRemoveAll
and sfRemoveAll
for variable sperading on the cluster. And some
more.
snowfall is also the R-connector to the
cluster management program sfCluster
. Mostly all of the
communication to this tool is done implicit and directly affecting the
initialisation via sfInit
. Using sfCluster
makes the
parallel programming with snowfall even more practicable in real
life environments.
For futher informations about the usage of sfCluster
look at
its documentation.
Jochen Knaus
Maintainer: Jochen Knaus <jo@imbi.uni-freiburg.de>,
snow (Simple Network of Workstations):
http://cran.r-project.org/src/contrib/Descriptions/snow.html
sfCluster
(Unix management tool for snowfall clusters):
http://www.imbi.uni-freiburg.de/parallel
Snowfall Initialisation: snowfall-init
Snowfall Calculation: snowfall-calculation
Snowfall Tools: snowfall-tools
Optional links to other man pages, e.g. snow-cluster
## Not run:
# Init Snowfall with settings from sfCluster
##sfInit()
# Init Snowfall with explicit settings.
sfInit( parallel=TRUE, cpus=2 )
if( sfParallel() )
cat( "Running in parallel mode on", sfCpus(), "nodes.\n" )
else
cat( "Running in sequential mode.\n" )
# Define some global objects.
globalVar1 <- c( "a", "b", "c" )
globalVar2 <- c( "d", "e" )
globalVar3 <- c( 1:10 )
globalNoExport <- "dummy"
# Define stupid little function.
calculate <- function( x ) {
cat( x )
return( 2 ^ x )
}
# Export all global objects except globalNoExport
# List of exported objects is listed.
# Work both parallel and sequential.
sfExportAll( except=c( "globalNoExport" ) )
# List objects on each node.
sfClusterEvalQ( ls() )
# Calc something with parallel sfLappy
cat( unlist( sfLapply( globalVar3, calculate ) ) )
# Remove all variables from object.
sfRemoveAll( except=c( "calculate" ) )
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.