foreach(i=1:nrow(m), .combine=rbind) %dopar% (m[i,] / mean(m[i,]))
stopCluster(cl)
::::::: failed
then on server.r
cl <- makeCluster(detectCores() - 1)
registerDoParallel(cl)
foreach(i=1:nrow(m), .combine=rbind) %dopar% (m[i,] / mean(m[i,]))
stopCluster(cl)
failed
work only if
cl <- makeCluster(detectCores() - 1)
foreach(i=1:nrow(m), .combine=rbind) %dopar% (m[i,] / mean(m[i,]))
stopCluster(cl)
but it means
no parallel ?
is there a solution to registered parallel process on shinyio ?
--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/b7ed88e8-0967-457b-87ad-6880cbefd5fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I passed with
/////////////////////////////////////////
library(doParallel)
gc()
cl <- makeCluster(detectCores() - 1, type ="FORK" )
registerDoParallel(cl)
foreach(i=1:nrow(m), .combine=rbind) %dopar%
(m[i,] / mean(m[i,]))
stopCluster(cl); rm(cl) ; gc()
////////////////////////////////////////////////
but I am not sure that is the best type for shinyappsio
I often obtain
"error: error reading from connection"
and the same on my computer (under win) with type = "SOCK"
so on my computer I move to doSNOW with
/////////////////////////////////////////
library(doSNOW)
gc()
cl <- makeCluster(detectCores() - 1, type ="SOCK" )
registerDoSNOW(cl)
foreach(i=1:nrow(m), .combine=rbind) %dopar%
(m[i,] / mean(m[i,]))
stopCluster(cl); rm(cl) ; gc()
////////////////////////////////////////////////
and it is much better
but the makeCluster of doSNOW doesn't work on shinyappsio
what is the exact type that I need to implement on my apps (https://ilostat.shinyapps.io/Rilostat)
thanks
Thanks Andy,
I used
library(doSNOW)
cl <- parallel::makeCluster(detectCores() - 1)
registerDoSNOW(cl)
foreach(i=1:nrow(m), .combine=rbind) %dopar%
(m[i,] / mean(m[i,]))
stopCluster(cl); rm(cl) ; gc()
and it work fine,
thanks
David