From: Benjamin Auder Date: Tue, 10 Jan 2017 23:02:55 +0000 (+0100) Subject: R.pkg: add a TODO X-Git-Url: https://git.auder.net/doc/html/css/current/scripts/pieces/%7B%7B%20targetUrl%20%7D%7D?a=commitdiff_plain;h=aa7daeaacfda268c392adf1c5efbccea77be9fe0;p=epclust.git R.pkg: add a TODO --- diff --git a/code/draft_R_pkg/R/main.R b/code/draft_R_pkg/R/main.R index 0b46da4..6746d88 100644 --- a/code/draft_R_pkg/R/main.R +++ b/code/draft_R_pkg/R/main.R @@ -55,6 +55,7 @@ epclust = function(data, K, nb_series_per_chunk, min_series_per_chunk=10*K, #concerning ncores, any non-integer type will be treated as "use parallel:detectCores()" #1) acquire data (process curves, get as coeffs) + #TODO: for data.frame and custom function, run in parallel (connections are sequential[?!]) index = 1 nb_curves = 0 repeat @@ -99,7 +100,7 @@ epclust = function(data, K, nb_series_per_chunk, min_series_per_chunk=10*K, library(parallel) ncores = ifelse(is.integer(ncores), ncores, parallel::detectCores()) cl = parallel::makeCluster(ncores) - parallel::clusterExport(cl=cl, varlist=c("X", "Y", "K", "p"), envir=environment()) + parallel::clusterExport(cl=cl, varlist=c("TODO:", "what", "to", "export?"), envir=environment()) #TODO: be careful of writing to a new temp file, then flush initial one, then re-use it... repeat { @@ -117,7 +118,7 @@ epclust = function(data, K, nb_series_per_chunk, min_series_per_chunk=10*K, } else if (remainder > 0) { #spread the load among other workers - + #... } li = parallel::parLapply(cl, indices, processChunk, K, WER=="mix") #C) flush tmp file (current parallel processes will write in it)