- # Right before the final stage, two situations are possible:
- # a. data to be processed now sit in binary format in medoids_file (if WER=="mix")
- # b. data still is the initial set of curves, referenced by the ntasks*K1 indices
- # So, the function getSeries() will potentially change. However, computeSynchrones()
- # requires a function retrieving the initial series. Thus, the next line saves future
- # conditional instructions.
- getRefSeries = getSeries
-
- if (WER=="mix")
- {
- indices = seq_len(ntasks*K2)
- # Now series (synchrones) must be retrieved from medoids_file
- getSeries = function(inds) getDataInFile(inds, medoids_file, nbytes, endian)
- # Contributions must be re-computed
- unlink(contribs_file)
- index = 1
- if (verbose)
- cat("...Serialize contributions computed on synchrones\n")
- ignored = binarizeTransform(getSeries,
- function(series) curvesToContribs(series, wf, ctype),
- contribs_file, nb_series_per_chunk, nbytes, endian)
- }
+ # For the last stage, ncores_tasks*(ncores_clusts+1) cores should be available:
+ # - ntasks for level 1 parallelism
+ # - ntasks*ncores_clust for level 2 parallelism,
+ # but since an extension MPI <--> tasks / OpenMP <--> sub-tasks is on the way,
+ # it's better to just re-use ncores_clust
+ ncores_last_stage <- ncores_clust