forgot to pass parll arg
authorBenjamin Auder <benjamin.auder@somewhere>
Wed, 8 Mar 2017 01:34:24 +0000 (02:34 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Wed, 8 Mar 2017 01:34:24 +0000 (02:34 +0100)
epclust/R/clustering.R
epclust/R/main.R

index 74d009e..14e1f83 100644 (file)
@@ -121,10 +121,7 @@ computeSynchrones = function(medoids, getRefSeries,
        for (inds in indices_workers)
        {
                if (verbose)
-               {
-                       cat(paste("--- Compute synchrones for indices range ",
-                               min(inds)," -> ",max(inds),"\n", sep=""))
-               }
+                       cat(paste("--- Compute synchrones for ",length(inds)," lines\n", sep=""))
                if (parll)
                        ignored <- parallel::mcparallel(computeSynchronesChunk(inds))
                else
@@ -184,14 +181,16 @@ computeWerDists = function(synchrones, ncores_clust=1,verbose=FALSE,parll=TRUE)
                ts.cwt = totts.cwt[,s0log:(s0log+noctave*nvoice)]
                #Normalization
                sqs <- sqrt(2^(0:(noctave*nvoice)/nvoice)*s0)
-               sqres <- sweep(ts.cwt,MARGIN=2,sqs,'*')
+               sqres <- sweep(ts.cwt,2,sqs,'*')
                sqres / max(Mod(sqres))
        }
 
        if (parll)
        {
                cl = parallel::makeCluster(ncores_clust)
-               parallel::clusterExport(cl, varlist=c("getContribs","K1","verbose"), envir=environment())
+               parallel::clusterExport(cl,
+                       varlist=c("synchrones","totnoct","nvoice","w0","s0log","noctave","s0","verbose"),
+                       envir=environment())
        }
 
        # (normalized) observations node with CWT
index 9064dfa..bf31c87 100644 (file)
@@ -222,9 +222,9 @@ claws = function(getSeries, K1, K2,
        if (verbose)
                cat("...Run final // stage 1 + stage 2\n")
        indices_medoids = clusteringTask1(
-               indices, getContribs, K1, nb_series_per_chunk, ncores_tasks*ncores_clust, verbose)
-       medoids = computeClusters2(getSeries(indices_medoids),
-               K2, getRefSeries, nb_curves, nb_series_per_chunk, ncores_tasks*ncores_clust, verbose)
+               indices, getContribs, K1, nb_series_per_chunk, ncores_tasks*ncores_clust, verbose, parll)
+       medoids = computeClusters2(getSeries(indices_medoids), K2,
+               getRefSeries, nb_curves, nb_series_per_chunk, ncores_tasks*ncores_clust, verbose, parll)
 
        # Cleanup
        unlink(bin_dir, recursive=TRUE)