R version 2.11.1 (2010-05-31) Copyright (C) 2010 The R Foundation for Statistical Computing 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. Natural language support but running in an English locale 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 an HTML browser interface to help. Type 'q()' to quit R. > > ### run with unix command > ### > ### nice -n 19 nohup R CMD BATCH --vanilla bar.R & > ### > ### after you start the job, it runs in background so you can > ### log out and it keeps running > > library(multicore) > library(rcdd) > > ### see rcdd package vignette, pages 8 and 16 > > set.seed(42) > > d <- 5 > ksplit <- 8 > nsplit <- 200 > x <- NULL > > for (isplit in 1:ksplit) { + xsplit <- matrix(rnorm(d * nsplit), ncol = d) + xsplit <- qdq(d2q(1e6 * xsplit), rep(d2q(1e6), length(xsplit))) + x <- rbind(x, xsplit) + foo <- cbind(0, cbind(1, xsplit)) + parallel(redundant(foo, representation = "V")) + } > > out <- collect() > > sapply(out, function(foo) nrow(foo$output)) 20484 20483 20482 20481 20480 20479 20478 20477 82 88 84 72 82 72 80 86 > > for (isplit in seq(1, length(out), by = 2)) { + foo <- rbind(out[[isplit]]$output, out[[isplit + 1]]$output) + parallel(redundant(foo, representation = "V")) + } > > out <- collect() > > sapply(out, function(foo) nrow(foo$output)) 20488 20487 20486 20485 111 114 105 114 > > for (isplit in seq(1, length(out), by = 2)) { + foo <- rbind(out[[isplit]]$output, out[[isplit + 1]]$output) + parallel(redundant(foo, representation = "V")) + } > > out <- collect() > > sapply(out, function(foo) nrow(foo$output)) 20512 20511 151 149 > > foo <- rbind(out[[1]]$output, out[[2]]$output) > out <- redundant(foo, representation = "V") > > nrow(out$output) [1] 185 > > > proc.time() user system elapsed 370.920 0.158 148.814