search for: stopwork

Displaying 3 results from an estimated 3 matches for "stopwork".

Did you mean: stopword
2010 Nov 10
2
Parallel code runs slower!
...0.07 123.47 # PARALLEL CODE nCols=ncol(t) nRows=nrow(t) tTA = matrix(nrow=nRows,ncol=nCols) require(doSMP) workers <- startWorkers(4) # My computer has 4 cores registerDoSMP(workers) system.time( foreach (i=1:nCols) %dopar%{ x = t[,i] xROC = ROC(x) tTA[,i]=xROC } ) # stop workers stopWorkers(workers) It is taking ages! Thanks, S
2011 Jun 28
1
parallel computing with 'foreach'
...,2,1,1,1,0,0), sex=c(0,0,0,0,1,1,1)) # Fit a stratified model coxph(Surv(time, status) ~ x + strata(sex), test1) w <- startWorkers() registerDoSMP(w) foreach(i=1:3) %dopar% { # Fit a stratified model fit<-coxph(Surv(time, status) ~ x + strata(sex), test1) summary(fit)$coef[i] } stopWorkers(w) ####Error message: Error in { : task 1 failed - "could not find function "coxph"" If I call library(survival) inside the foreach loop, everything runs properly. I don't think that I should have to call the package iteratively inside the loop. I would like to use a...
2011 May 27
0
saving multiple arrays from a foreach loop
...y computer has 2 cores registerDoSMP(workers) notcreative = array(NA,dim=c(4,n.vpn,n.l?ufe)) tempList = list(matrix(NA,4,n.vpn),matrix(NA,4,n.vpn)) system.time(notcreative <- foreach(j=1:n.run) %dopar% { tempList=check(j) x[,,j] = tempList$sme y[,,j] = tempList$test }) stopWorkers(workers) -- ____________ lic. phil. Nicolas A. J. Berkowitsch Universit?t Basel Fakult?t f?r Psychologie Economic Psychology Missionsstrasse 62a CH-4055 Basel Tel. +41 61 267 05 75 E-Mail nicolas.berkowitsch at unibas.ch Web http://psycho.unibas.ch/abteilungen/abteilung-details/h...