X-Git-Url: https://git.auder.net/?p=epclust.git;a=blobdiff_plain;f=epclust%2FR%2Fmain.R;h=eded9523e4c2cc1c8316ed01617e35dfa13c6b18;hp=6746d88a3d14b3e83b53f97c39b70d0d3ab5cfd2;hb=dc1aa85a96bbf815b0d896c22a9b4a539a9e8a9c;hpb=a810626c29b34a0aec00119e8245b01de1a292fc diff --git a/epclust/R/main.R b/epclust/R/main.R index 6746d88..eded952 100644 --- a/epclust/R/main.R +++ b/epclust/R/main.R @@ -52,7 +52,7 @@ epclust = function(data, K, nb_series_per_chunk, min_series_per_chunk=10*K, stop("read/writeTmp should be functional (see defaults.R)") if (WER!="end" && WER!="mix") stop("WER takes values in {'end','mix'}") - #concerning ncores, any non-integer type will be treated as "use parallel:detectCores()" + #concerning ncores, any non-integer type will be treated as "use parallel:detectCores()/4" #1) acquire data (process curves, get as coeffs) #TODO: for data.frame and custom function, run in parallel (connections are sequential[?!]) @@ -98,7 +98,7 @@ epclust = function(data, K, nb_series_per_chunk, min_series_per_chunk=10*K, #2) process coeffs (by nb_series_per_chunk) and cluster them in parallel library(parallel) - ncores = ifelse(is.integer(ncores), ncores, parallel::detectCores()) + ncores = ifelse(is.integer(ncores), ncores, parallel::detectCores()%/%4) cl = parallel::makeCluster(ncores) 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...