fix CGDS usage, compilation, check usability
authorBenjamin Auder <benjamin.auder@somewhere>
Sun, 16 Oct 2016 22:23:23 +0000 (00:23 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Sun, 16 Oct 2016 22:23:23 +0000 (00:23 +0200)
.gitignore
README.md
code/README
code/src/main.sh [moved from code/main.sh with 100% similarity]
code/src/stage1/Algorithm/pam.c
code/src/stage1/CMakeLists.txt
code/src/stage1/TimeSeries/serialize.c
code/src/stage1/Util/utils.c
code/src/stage1/main.c

index 112c581..0372ddc 100644 (file)
@@ -1,4 +1,5 @@
-/code/build/*
+/code/src/build/*
+/code/test/build/*
 /code/data/src/
 
 *.aux
index d510f69..2b103b2 100644 (file)
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ Joint work with [Jairo Cugliari](http://eric.univ-lyon2.fr/~jcugliari/),
 ---
 
 This program takes n time-series in input and is divided in two stages:
-  1) (Heuristic) k-medoids algorithm in parallel to obtain K centers, K << n
+       1) (Heuristic) k-medoids algorithm in parallel to obtain K centers, K << n
        2) Filtering WER(?) to obtain the final k < K group representations.
 
 ---
index ccb3a0f..5546cf6 100644 (file)
@@ -1,14 +1,16 @@
 To compile source code :
 
-   cd build
-   cmake ../src
+   (mkdir -p (src|test)/build
+   cd (src|test)/build
+   cmake ..
    make
 
 Usage :
 
-   ppam-mpi cluster ifilename nbSeriesInChunk nbClusters randomize p_for_dissims
+   mpirun -np nbProcess ppam.exe cluster ifilename nbSeriesInChunk nbClusters randomize p_for_dissims
 
 Where :
+   nbProcess = number of simultaneous processes
    ifilename = path to serialized dataset (read below)
    nbSeriesInChunk = number of time-series to process sequentially
    nbClusters = number of clusters
similarity index 100%
rename from code/main.sh
rename to code/src/main.sh
index 4e3dfac..7cde367 100644 (file)
@@ -1,6 +1,6 @@
 #include "Util/types.h"
 #include "Util/rng.h"
-#include <cds/Vector.h>
+#include <cgds/Vector.h>
 #include <stdlib.h>
 #include <math.h>
 
index e69ca5d..b69602f 100644 (file)
@@ -11,9 +11,11 @@ include_directories("${CMAKE_SOURCE_DIR}")
 #ppam executable (serialize, cluster, classif)
 
 #cds
-find_path(CDS_INCLUDE_PATH "cds/cds.h")
-find_library(CDS_LIBRARY cds)
-include_directories(${CDS_INCLUDE_PATH})
+set(CGDS_INCLUDE_PATH "/usr/local/include/cgds")
+#set(CGDS_LIBRARY "/usr/local/lib/libcgds.so")
+#find_path(CDS_INCLUDE_PATH "cgds/cgds.h")
+#find_library(CGDS_LIBRARY cgds)
+include_directories(${CGDS_INCLUDE_PATH})
 
 #GSL: standard location
 find_path(GSL_INCLUDE_PATH "gsl/gsl_linalg.h")
@@ -33,8 +35,8 @@ include_directories(${LIBXML2_INCLUDE_DIR})
 file(GLOB_RECURSE ppam_src "${CMAKE_SOURCE_DIR}/*.c")
 add_executable(ppam.exe ${ppam_src})
 add_library(ppam SHARED ${ppam_src})
-target_link_libraries(ppam.exe m cds ${MPI_LIBRARIES} ${LIBXML2_LIBRARIES} ${GSL_LIBRARIES} ${CDS_LIBRARY})
-target_link_libraries(ppam m cds ${MPI_LIBRARIES} ${LIBXML2_LIBRARIES} ${GSL_LIBRARIES} ${CDS_LIBRARY})
+target_link_libraries(ppam.exe m cgds ${MPI_LIBRARIES} ${LIBXML2_LIBRARIES} ${GSL_LIBRARIES})# ${CGDS_LIBRARY})
+target_link_libraries(ppam m cgds ${MPI_LIBRARIES} ${LIBXML2_LIBRARIES} ${GSL_LIBRARIES})# ${CGDS_LIBRARY})
 
 if (MPI_COMPILE_FLAGS)
        set_target_properties(ppam.exe PROPERTIES
index ab552c9..88b15f1 100644 (file)
@@ -4,7 +4,7 @@
 #include <math.h>
 #include "Util/types.h"
 #include "Util/utils.h"
-#include <cds/Vector.h>
+#include <cgds/Vector.h>
 #include <string.h>
 
 // parse a line into two integers (ID, raw power)
@@ -156,7 +156,7 @@ void serialize_byCols(const char* ifileName, const char* ofileName, uint32_t nbI
                {
                        //just starting a new time-series: must process the last one (if there is a last one !)
                        if (lastID > 0)
-                       {                               
+                       {
                                if (tsLength == refTsLength && !overflow)
                                {
                                        seriesCount++;
index 3786eda..9713e30 100644 (file)
@@ -1,6 +1,6 @@
 #include "Util/utils.h"
 #include <math.h>
-#include <cds/Vector.h>
+#include <cgds/Vector.h>
 
 void free_work(Work_t* work)
 {
index bb4bd46..992b97c 100644 (file)
@@ -10,7 +10,7 @@
 #include "TimeSeries/deserialize.h"
 #include "Classification/getClass.h"
 #include <string.h>
-#include <cds/Vector.h>
+#include <cgds/Vector.h>
 #include <libxml/xmlreader.h>
 
 // serialize text file argv[1] into a binary file argv[2]