R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("snowFT-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('snowFT') Loading required package: snow Loading required package: rpvm > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "snowFT-cluster" > > ### * snowFT-cluster > > flush(stderr()); flush(stdout()) > > ### Name: snowFT-cluster > ### Title: Cluster-Level Functions with Fault Tolerant Features > ### Aliases: performParallel clusterApplyFT clusterCallpart > ### clusterEvalQpart > ### Keywords: programming > > ### ** Examples > > ## Not run: > ##D # generates n normally distributed random numbers in r replicates > ##D # on p nodes and prints their mean after each r/10 replicate. > ##D > ##D printfun <- function(res, n, args=NULL) { > ##D res <- unlist(res) > ##D res <- res[!is.null(res)] > ##D print(paste("mean after:", n,"replicates:", mean(res), > ##D "(from",length(res),"RNs)")) > ##D } > ##D > ##D r<-1000; n<-100; p<-5 > ##D res <- performParallel(p, rep(n,r), fun=rnorm, > ##D gentype="RNGstream", seed=rep(1,6), printfun=printfun) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "snowFT-rand" > > ### * snowFT-rand > > flush(stderr()); flush(stdout()) > > ### Name: snowFT-rand > ### Title: Random Number Generation > ### Aliases: clusterSetupRNG.FT clusterSetupRNGstreamRepli > ### Keywords: programming > > ### ** Examples > > ## Not run: > ##D cl <- makeClusterFT(3) > ##D r<-10 > ##D clusterSetupRNG.FT(cl, type="RNGstream", streamper="replicate",n=r, seed=rep(1,6)) > ##D res<-clusterApplyFT(cl,rep(5,10),rnorm,gentype="RNGstream") > ##D stopCluster(res[[2]]) > ##D print(res[[1]]) > ##D > ## End(Not run) > > > > cleanEx(); ..nameEx <- "snowFT-repair" > > ### * snowFT-repair > > flush(stderr()); flush(stdout()) > > ### Name: snowFT-repair > ### Title: Repairing a Cluster > ### Aliases: addtoCluster removefromCluster repairCluster > ### Keywords: programming > > ### ** Examples > > ## Not run: > ##D cl <- makeClusterFT(5) > ##D clusterApply(cl, 1:5, get("+"), 3) > ##D cl <- addtoCluster(cl,3) > ##D fail<-findFailedNodes(cl) > ##D cl<-repairCluster(cl,fail[,1]) > ##D clusterApply(cl, 1:8, get("+"), 3) > ##D stopCluster(cl) > ## End(Not run) > > > > cleanEx(); ..nameEx <- "snowFT-startstop" > > ### * snowFT-startstop > > flush(stderr()); flush(stdout()) > > ### Name: snowFT-startstop > ### Title: Starting snowFT Clusters > ### Aliases: makeClusterFT > ### Keywords: programming > > ### ** Examples > > ## Not run: > ##D cl <- makeClusterFT(5) > ##D res <- clusterApplyFT(cl, 1:10, get("+"), ...=3) > ##D stopCluster(res[[2]]) > ##D print(res[[1]]) > ##D > ## End(Not run) > > > > ### *