From: Benjamin Auder Date: Thu, 19 Jan 2017 00:59:47 +0000 (+0100) Subject: firx error in slave.c X-Git-Url: https://git.auder.net/%7B%7B%20asset%28%27mixstore/css/current/%3C?a=commitdiff_plain;h=14cb6cf8266c0e1299f16a4b2352f54dbae26f44;p=epclust.git firx error in slave.c --- diff --git a/TODO b/TODO index 6937975..9fd325a 100644 --- a/TODO +++ b/TODO @@ -17,8 +17,21 @@ https://docs.docker.com/engine/getstarted/step_one/ A faire: - finir les experiences (sur nb de classes, nb de curves / chunk, nb de procs) et sur d'autres architectures - ==> code OK, source("wrapper.R") puis - serialize("build", "pathTo2010.csv","pathTo2010.bin") + + + + + +dans old_C_code/build : +cmake ../stage1/src +make + +dans data/, lancer R puis : +source("../old_C_code/wrapper.R") +serialize("../old_C_code/build", "2009.csv","2009.bin") + + + ppam_exe("build",np,"pathTo2010.bin","nbSeriesPerChunk nbClusters 1 2") C = getMedoids("build", "ppamResult.xml", "ppamFinalSeries.bin") quelques_series = deserialize("pathTo2010.bin", rangs...) diff --git a/old_C_code/.gitignore b/old_C_code/.gitignore index db6ef2b..f9c22cb 100644 --- a/old_C_code/.gitignore +++ b/old_C_code/.gitignore @@ -1,9 +1,6 @@ #ignore building files and folders build/ -#ignore "real" data (way too large) -data/ - #ignore object files + library *.o *.so diff --git a/old_C_code/stage1/src/MPI_Main/slave.c b/old_C_code/stage1/src/MPI_Main/slave.c index e66f599..d7d0afe 100644 --- a/old_C_code/stage1/src/MPI_Main/slave.c +++ b/old_C_code/stage1/src/MPI_Main/slave.c @@ -20,7 +20,7 @@ static Result_t* do_work(Work_t* work) uint32_t nbSeries = work->nbSeries; uint32_t tsLength = get_tsLength(work->inputFileName); - uint32_t nbValues = (tsLength - 4) / 3; + uint32_t nbValues = (tsLength - 4) / 4; // nbReducedCoordinates = smallest power of 2 which is above nbValues uint32_t nbReducedCoordinates = (uint32_t)ceil(log2(nbValues)); diff --git a/old_C_code/stage2/src/.gitkeep b/old_C_code/stage2_UNFINISHED/src/.gitkeep similarity index 100% rename from old_C_code/stage2/src/.gitkeep rename to old_C_code/stage2_UNFINISHED/src/.gitkeep diff --git a/old_C_code/stage2/src/00_convertir-donnnes_2009.r b/old_C_code/stage2_UNFINISHED/src/00_convertir-donnnes_2009.r similarity index 100% rename from old_C_code/stage2/src/00_convertir-donnnes_2009.r rename to old_C_code/stage2_UNFINISHED/src/00_convertir-donnnes_2009.r diff --git a/old_C_code/stage2/src/00_convertir-donnnes_2010.r b/old_C_code/stage2_UNFINISHED/src/00_convertir-donnnes_2010.r similarity index 100% rename from old_C_code/stage2/src/00_convertir-donnnes_2010.r rename to old_C_code/stage2_UNFINISHED/src/00_convertir-donnnes_2010.r diff --git a/old_C_code/stage2/src/01_extract-features_2009.r b/old_C_code/stage2_UNFINISHED/src/01_extract-features_2009.r similarity index 100% rename from old_C_code/stage2/src/01_extract-features_2009.r rename to old_C_code/stage2_UNFINISHED/src/01_extract-features_2009.r diff --git a/old_C_code/stage2/src/01_extract-features_2010.r b/old_C_code/stage2_UNFINISHED/src/01_extract-features_2010.r similarity index 100% rename from old_C_code/stage2/src/01_extract-features_2010.r rename to old_C_code/stage2_UNFINISHED/src/01_extract-features_2010.r diff --git a/old_C_code/stage2/src/02_cluster_2009.r b/old_C_code/stage2_UNFINISHED/src/02_cluster_2009.r similarity index 100% rename from old_C_code/stage2/src/02_cluster_2009.r rename to old_C_code/stage2_UNFINISHED/src/02_cluster_2009.r diff --git a/old_C_code/stage2/src/03_compute-sums-of-classes_2009.r b/old_C_code/stage2_UNFINISHED/src/03_compute-sums-of-classes_2009.r similarity index 100% rename from old_C_code/stage2/src/03_compute-sums-of-classes_2009.r rename to old_C_code/stage2_UNFINISHED/src/03_compute-sums-of-classes_2009.r diff --git a/old_C_code/stage2/src/05_cluster2stepWER.r b/old_C_code/stage2_UNFINISHED/src/05_cluster2stepWER.r similarity index 100% rename from old_C_code/stage2/src/05_cluster2stepWER.r rename to old_C_code/stage2_UNFINISHED/src/05_cluster2stepWER.r diff --git a/old_C_code/stage2/src/06_predictions.r b/old_C_code/stage2_UNFINISHED/src/06_predictions.r similarity index 100% rename from old_C_code/stage2/src/06_predictions.r rename to old_C_code/stage2_UNFINISHED/src/06_predictions.r diff --git a/old_C_code/stage2/src/unused/00_convertir-donnnes_2011.r b/old_C_code/stage2_UNFINISHED/src/unused/00_convertir-donnnes_2011.r similarity index 100% rename from old_C_code/stage2/src/unused/00_convertir-donnnes_2011.r rename to old_C_code/stage2_UNFINISHED/src/unused/00_convertir-donnnes_2011.r diff --git a/old_C_code/stage2/src/unused/00_createCalendar.r b/old_C_code/stage2_UNFINISHED/src/unused/00_createCalendar.r similarity index 100% rename from old_C_code/stage2/src/unused/00_createCalendar.r rename to old_C_code/stage2_UNFINISHED/src/unused/00_createCalendar.r diff --git a/old_C_code/stage2/src/unused/00_plots-energycon.r b/old_C_code/stage2_UNFINISHED/src/unused/00_plots-energycon.r similarity index 100% rename from old_C_code/stage2/src/unused/00_plots-energycon.r rename to old_C_code/stage2_UNFINISHED/src/unused/00_plots-energycon.r diff --git a/old_C_code/stage2/src/unused/01_StBr.r b/old_C_code/stage2_UNFINISHED/src/unused/01_StBr.r similarity index 100% rename from old_C_code/stage2/src/unused/01_StBr.r rename to old_C_code/stage2_UNFINISHED/src/unused/01_StBr.r diff --git a/old_C_code/stage2/src/unused/01_extract-features2_2009.r b/old_C_code/stage2_UNFINISHED/src/unused/01_extract-features2_2009.r similarity index 100% rename from old_C_code/stage2/src/unused/01_extract-features2_2009.r rename to old_C_code/stage2_UNFINISHED/src/unused/01_extract-features2_2009.r diff --git a/old_C_code/stage2/src/unused/02_cluster-par_2009.r b/old_C_code/stage2_UNFINISHED/src/unused/02_cluster-par_2009.r similarity index 100% rename from old_C_code/stage2/src/unused/02_cluster-par_2009.r rename to old_C_code/stage2_UNFINISHED/src/unused/02_cluster-par_2009.r diff --git a/old_C_code/stage2/src/unused/03_compute-sums-of-classes-par_2009.r b/old_C_code/stage2_UNFINISHED/src/unused/03_compute-sums-of-classes-par_2009.r similarity index 100% rename from old_C_code/stage2/src/unused/03_compute-sums-of-classes-par_2009.r rename to old_C_code/stage2_UNFINISHED/src/unused/03_compute-sums-of-classes-par_2009.r diff --git a/old_C_code/stage2/src/unused/03_compute-sums-of-classesRANDOM-par_2009.r b/old_C_code/stage2_UNFINISHED/src/unused/03_compute-sums-of-classesRANDOM-par_2009.r similarity index 100% rename from old_C_code/stage2/src/unused/03_compute-sums-of-classesRANDOM-par_2009.r rename to old_C_code/stage2_UNFINISHED/src/unused/03_compute-sums-of-classesRANDOM-par_2009.r diff --git a/old_C_code/stage2/src/unused/03_compute-sums-of-classesRANDOM_2009.r b/old_C_code/stage2_UNFINISHED/src/unused/03_compute-sums-of-classesRANDOM_2009.r similarity index 100% rename from old_C_code/stage2/src/unused/03_compute-sums-of-classesRANDOM_2009.r rename to old_C_code/stage2_UNFINISHED/src/unused/03_compute-sums-of-classesRANDOM_2009.r diff --git a/old_C_code/stage2/src/unused/03_compute-sums-of-classesRANDOM_2010.r b/old_C_code/stage2_UNFINISHED/src/unused/03_compute-sums-of-classesRANDOM_2010.r similarity index 100% rename from old_C_code/stage2/src/unused/03_compute-sums-of-classesRANDOM_2010.r rename to old_C_code/stage2_UNFINISHED/src/unused/03_compute-sums-of-classesRANDOM_2010.r diff --git a/old_C_code/stage2/src/unused/03_compute-sums-of-classes_2010-par.r b/old_C_code/stage2_UNFINISHED/src/unused/03_compute-sums-of-classes_2010-par.r similarity index 100% rename from old_C_code/stage2/src/unused/03_compute-sums-of-classes_2010-par.r rename to old_C_code/stage2_UNFINISHED/src/unused/03_compute-sums-of-classes_2010-par.r diff --git a/old_C_code/stage2/src/unused/03_compute-sums-of-classes_2010.r b/old_C_code/stage2_UNFINISHED/src/unused/03_compute-sums-of-classes_2010.r similarity index 100% rename from old_C_code/stage2/src/unused/03_compute-sums-of-classes_2010.r rename to old_C_code/stage2_UNFINISHED/src/unused/03_compute-sums-of-classes_2010.r diff --git a/old_C_code/stage2/src/unused/04_predictions.r b/old_C_code/stage2_UNFINISHED/src/unused/04_predictions.r similarity index 100% rename from old_C_code/stage2/src/unused/04_predictions.r rename to old_C_code/stage2_UNFINISHED/src/unused/04_predictions.r diff --git a/old_C_code/stage2/src/unused/05_cluster2step.r b/old_C_code/stage2_UNFINISHED/src/unused/05_cluster2step.r similarity index 100% rename from old_C_code/stage2/src/unused/05_cluster2step.r rename to old_C_code/stage2_UNFINISHED/src/unused/05_cluster2step.r diff --git a/old_C_code/stage2/src/unused/05_cluster2stepWER-RANDOM.r b/old_C_code/stage2_UNFINISHED/src/unused/05_cluster2stepWER-RANDOM.r similarity index 100% rename from old_C_code/stage2/src/unused/05_cluster2stepWER-RANDOM.r rename to old_C_code/stage2_UNFINISHED/src/unused/05_cluster2stepWER-RANDOM.r diff --git a/old_C_code/stage2/src/unused/05_cluster2stepWER-par.r b/old_C_code/stage2_UNFINISHED/src/unused/05_cluster2stepWER-par.r similarity index 100% rename from old_C_code/stage2/src/unused/05_cluster2stepWER-par.r rename to old_C_code/stage2_UNFINISHED/src/unused/05_cluster2stepWER-par.r diff --git a/old_C_code/stage2/src/unused/06_predictions-ICAME.r b/old_C_code/stage2_UNFINISHED/src/unused/06_predictions-ICAME.r similarity index 100% rename from old_C_code/stage2/src/unused/06_predictions-ICAME.r rename to old_C_code/stage2_UNFINISHED/src/unused/06_predictions-ICAME.r diff --git a/old_C_code/stage2/src/unused/06_predictions-RANDOM.r b/old_C_code/stage2_UNFINISHED/src/unused/06_predictions-RANDOM.r similarity index 100% rename from old_C_code/stage2/src/unused/06_predictions-RANDOM.r rename to old_C_code/stage2_UNFINISHED/src/unused/06_predictions-RANDOM.r diff --git a/old_C_code/stage2/src/unused/06_predictions-par.r b/old_C_code/stage2_UNFINISHED/src/unused/06_predictions-par.r similarity index 100% rename from old_C_code/stage2/src/unused/06_predictions-par.r rename to old_C_code/stage2_UNFINISHED/src/unused/06_predictions-par.r diff --git a/old_C_code/stage2/src/unused/analysis-SME.r b/old_C_code/stage2_UNFINISHED/src/unused/analysis-SME.r similarity index 100% rename from old_C_code/stage2/src/unused/analysis-SME.r rename to old_C_code/stage2_UNFINISHED/src/unused/analysis-SME.r diff --git a/old_C_code/stage2/src/unused/aux.r b/old_C_code/stage2_UNFINISHED/src/unused/aux.r similarity index 100% rename from old_C_code/stage2/src/unused/aux.r rename to old_C_code/stage2_UNFINISHED/src/unused/aux.r diff --git a/old_C_code/stage2/src/unused/aux2.r b/old_C_code/stage2_UNFINISHED/src/unused/aux2.r similarity index 100% rename from old_C_code/stage2/src/unused/aux2.r rename to old_C_code/stage2_UNFINISHED/src/unused/aux2.r diff --git a/old_C_code/stage2/src/unused/calendar_ir.txt b/old_C_code/stage2_UNFINISHED/src/unused/calendar_ir.txt similarity index 100% rename from old_C_code/stage2/src/unused/calendar_ir.txt rename to old_C_code/stage2_UNFINISHED/src/unused/calendar_ir.txt diff --git a/old_C_code/stage2/src/unused/calendar_transition_groups-1996-2011.txt b/old_C_code/stage2_UNFINISHED/src/unused/calendar_transition_groups-1996-2011.txt similarity index 100% rename from old_C_code/stage2/src/unused/calendar_transition_groups-1996-2011.txt rename to old_C_code/stage2_UNFINISHED/src/unused/calendar_transition_groups-1996-2011.txt diff --git a/old_C_code/stage2/src/unused/datesall.txt b/old_C_code/stage2_UNFINISHED/src/unused/datesall.txt similarity index 100% rename from old_C_code/stage2/src/unused/datesall.txt rename to old_C_code/stage2_UNFINISHED/src/unused/datesall.txt diff --git a/old_C_code/stage2/src/unused/descriptive-32K.r b/old_C_code/stage2_UNFINISHED/src/unused/descriptive-32K.r similarity index 100% rename from old_C_code/stage2/src/unused/descriptive-32K.r rename to old_C_code/stage2_UNFINISHED/src/unused/descriptive-32K.r diff --git a/old_C_code/stage2/src/unused/effectives-per-classe.r b/old_C_code/stage2_UNFINISHED/src/unused/effectives-per-classe.r similarity index 100% rename from old_C_code/stage2/src/unused/effectives-per-classe.r rename to old_C_code/stage2_UNFINISHED/src/unused/effectives-per-classe.r diff --git a/old_C_code/stage2/src/unused/identifs.txt b/old_C_code/stage2_UNFINISHED/src/unused/identifs.txt similarity index 100% rename from old_C_code/stage2/src/unused/identifs.txt rename to old_C_code/stage2_UNFINISHED/src/unused/identifs.txt diff --git a/old_C_code/stage2/src/unused/sowas-superseded.r b/old_C_code/stage2_UNFINISHED/src/unused/sowas-superseded.r similarity index 100% rename from old_C_code/stage2/src/unused/sowas-superseded.r rename to old_C_code/stage2_UNFINISHED/src/unused/sowas-superseded.r diff --git a/old_C_code/stage2/test/.gitkeep b/old_C_code/stage2_UNFINISHED/test/.gitkeep similarity index 100% rename from old_C_code/stage2/test/.gitkeep rename to old_C_code/stage2_UNFINISHED/test/.gitkeep diff --git a/old_C_code/stage1/wrapper.R b/old_C_code/wrapper.R similarity index 89% rename from old_C_code/stage1/wrapper.R rename to old_C_code/wrapper.R index ec859dc..ee15a79 100644 --- a/old_C_code/stage1/wrapper.R +++ b/old_C_code/wrapper.R @@ -1,6 +1,8 @@ ppam_exe = function(path=".", np=parallel::detectCores(), data=NULL, - args="DontLetMeEmptyPlease!") + nbSeriesPerChunk, nbClusters, randomize=1, p_dissims=2) { + args = paste(nbSeriesPerChunk," ",nbClusters," ",randomize," ",p_dissims,sep="") + command_line = paste("mpirun -np ",np," ",path,"/ppam.exe cluster",sep="") #if data provided (as data.frame or matrix...): binarize it, and add it as first argument @@ -46,8 +48,9 @@ serialize = function(path=".", csvSeries, binSeries, byCols=0, nbSeries=0) sep="")) } -deserialize = function(path=".", binSeries, csvSeries, ranks="-1") +deserialize = function(path=".", binSeries, csvSeries, ranks="-1", return=TRUE) { system(paste(path,"/ppam.exe deserialize ",binSeries," ",csvSeries," ",ranks,sep="")) - return ( read.table(csvSeries, sep=",") ) + if (return) + return ( read.table(csvSeries, sep=",") ) }