+ #2) process coeffs (by nbSeriesPerChunk) and cluster in parallel (just launch async task, wait for them to complete, and re-do if necessary)
+ repeat
+ {
+ completed = rep(FALSE, ............)
+ #while there is jobs to do (i.e. size of tmp "file" is greater than nbSeriesPerChunk),
+ #A) determine which tasks which processor will do (OK)
+ #B) send each (sets of) tasks in parallel
+ #C) flush tmp file (current parallel processes will write in it)
+ #always check "complete" flag (array, as I did in MPI) to know if "slaves" finished
+ }
+
+parallel::stopCluster(cl)
+
+ #3) readTmp last results, apply PAM on it, and return medoids + identifiers
+
+ #4) apply stage 2 (in parallel ? inside task 2) ?)
+ if (WER == "end")
+ {
+ #from center curves, apply stage 2...
+ }
+}
+
+getCoeffs = function(series)
+{
+ #... return wavelets coeffs : compute in parallel !