From: Benjamin Auder Date: Sun, 16 Oct 2016 22:42:05 +0000 (+0200) Subject: improve project structure X-Git-Url: https://git.auder.net/doc/html/css/img/current/gitweb.css?a=commitdiff_plain;h=4b7107ce2a0bb77b5b65a9b0617192b0a07fda29;p=epclust.git improve project structure --- diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0372ddc..0000000 --- a/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -/code/src/build/* -/code/test/build/* -/code/data/src/ - -*.aux -*.log -*.nav -*.snm -*.toc -*.out diff --git a/code/.gitignore b/code/.gitignore new file mode 100644 index 0000000..f8a6218 --- /dev/null +++ b/code/.gitignore @@ -0,0 +1,2 @@ +#ignore "real" data (way too large) +data/ diff --git a/code/README b/code/README index 5546cf6..fa76933 100644 --- a/code/README +++ b/code/README @@ -1,8 +1,7 @@ To compile source code : - (mkdir -p (src|test)/build - cd (src|test)/build - cmake .. + cd build/stage1/src #and then stage2 + cmake ../../../stage1/src make Usage : diff --git a/code/src/stage1/Algorithm/compute_coefficients.c b/code/stage1/src/Algorithm/compute_coefficients.c similarity index 100% rename from code/src/stage1/Algorithm/compute_coefficients.c rename to code/stage1/src/Algorithm/compute_coefficients.c diff --git a/code/src/stage1/Algorithm/compute_coefficients.h b/code/stage1/src/Algorithm/compute_coefficients.h similarity index 100% rename from code/src/stage1/Algorithm/compute_coefficients.h rename to code/stage1/src/Algorithm/compute_coefficients.h diff --git a/code/src/stage1/Algorithm/get_dissimilarities.c b/code/stage1/src/Algorithm/get_dissimilarities.c similarity index 100% rename from code/src/stage1/Algorithm/get_dissimilarities.c rename to code/stage1/src/Algorithm/get_dissimilarities.c diff --git a/code/src/stage1/Algorithm/get_dissimilarities.h b/code/stage1/src/Algorithm/get_dissimilarities.h similarity index 100% rename from code/src/stage1/Algorithm/get_dissimilarities.h rename to code/stage1/src/Algorithm/get_dissimilarities.h diff --git a/code/src/stage1/Algorithm/pam.c b/code/stage1/src/Algorithm/pam.c similarity index 100% rename from code/src/stage1/Algorithm/pam.c rename to code/stage1/src/Algorithm/pam.c diff --git a/code/src/stage1/Algorithm/pam.h b/code/stage1/src/Algorithm/pam.h similarity index 100% rename from code/src/stage1/Algorithm/pam.h rename to code/stage1/src/Algorithm/pam.h diff --git a/code/src/stage1/CMakeLists.txt b/code/stage1/src/CMakeLists.txt similarity index 100% rename from code/src/stage1/CMakeLists.txt rename to code/stage1/src/CMakeLists.txt diff --git a/code/src/stage1/Classification/_Readme b/code/stage1/src/Classification/_Readme similarity index 100% rename from code/src/stage1/Classification/_Readme rename to code/stage1/src/Classification/_Readme diff --git a/code/src/stage1/Classification/getClass.c b/code/stage1/src/Classification/getClass.c similarity index 100% rename from code/src/stage1/Classification/getClass.c rename to code/stage1/src/Classification/getClass.c diff --git a/code/src/stage1/Classification/getClass.h b/code/stage1/src/Classification/getClass.h similarity index 100% rename from code/src/stage1/Classification/getClass.h rename to code/stage1/src/Classification/getClass.h diff --git a/code/src/stage1/MPI_Communication/pack.c b/code/stage1/src/MPI_Communication/pack.c similarity index 100% rename from code/src/stage1/MPI_Communication/pack.c rename to code/stage1/src/MPI_Communication/pack.c diff --git a/code/src/stage1/MPI_Communication/pack.h b/code/stage1/src/MPI_Communication/pack.h similarity index 100% rename from code/src/stage1/MPI_Communication/pack.h rename to code/stage1/src/MPI_Communication/pack.h diff --git a/code/src/stage1/MPI_Communication/unpack.c b/code/stage1/src/MPI_Communication/unpack.c similarity index 100% rename from code/src/stage1/MPI_Communication/unpack.c rename to code/stage1/src/MPI_Communication/unpack.c diff --git a/code/src/stage1/MPI_Communication/unpack.h b/code/stage1/src/MPI_Communication/unpack.h similarity index 100% rename from code/src/stage1/MPI_Communication/unpack.h rename to code/stage1/src/MPI_Communication/unpack.h diff --git a/code/src/stage1/MPI_Main/master.c b/code/stage1/src/MPI_Main/master.c similarity index 100% rename from code/src/stage1/MPI_Main/master.c rename to code/stage1/src/MPI_Main/master.c diff --git a/code/src/stage1/MPI_Main/master.h b/code/stage1/src/MPI_Main/master.h similarity index 100% rename from code/src/stage1/MPI_Main/master.h rename to code/stage1/src/MPI_Main/master.h diff --git a/code/src/stage1/MPI_Main/slave.c b/code/stage1/src/MPI_Main/slave.c similarity index 100% rename from code/src/stage1/MPI_Main/slave.c rename to code/stage1/src/MPI_Main/slave.c diff --git a/code/src/stage1/MPI_Main/slave.h b/code/stage1/src/MPI_Main/slave.h similarity index 100% rename from code/src/stage1/MPI_Main/slave.h rename to code/stage1/src/MPI_Main/slave.h diff --git a/code/src/stage1/TimeSeries/deserialize.c b/code/stage1/src/TimeSeries/deserialize.c similarity index 100% rename from code/src/stage1/TimeSeries/deserialize.c rename to code/stage1/src/TimeSeries/deserialize.c diff --git a/code/src/stage1/TimeSeries/deserialize.h b/code/stage1/src/TimeSeries/deserialize.h similarity index 100% rename from code/src/stage1/TimeSeries/deserialize.h rename to code/stage1/src/TimeSeries/deserialize.h diff --git a/code/src/stage1/TimeSeries/serialize.c b/code/stage1/src/TimeSeries/serialize.c similarity index 100% rename from code/src/stage1/TimeSeries/serialize.c rename to code/stage1/src/TimeSeries/serialize.c diff --git a/code/src/stage1/TimeSeries/serialize.h b/code/stage1/src/TimeSeries/serialize.h similarity index 100% rename from code/src/stage1/TimeSeries/serialize.h rename to code/stage1/src/TimeSeries/serialize.h diff --git a/code/src/stage1/Util/rng.c b/code/stage1/src/Util/rng.c similarity index 100% rename from code/src/stage1/Util/rng.c rename to code/stage1/src/Util/rng.c diff --git a/code/src/stage1/Util/rng.h b/code/stage1/src/Util/rng.h similarity index 100% rename from code/src/stage1/Util/rng.h rename to code/stage1/src/Util/rng.h diff --git a/code/src/stage1/Util/types.h b/code/stage1/src/Util/types.h similarity index 100% rename from code/src/stage1/Util/types.h rename to code/stage1/src/Util/types.h diff --git a/code/src/stage1/Util/utils.c b/code/stage1/src/Util/utils.c similarity index 100% rename from code/src/stage1/Util/utils.c rename to code/stage1/src/Util/utils.c diff --git a/code/src/stage1/Util/utils.h b/code/stage1/src/Util/utils.h similarity index 100% rename from code/src/stage1/Util/utils.h rename to code/stage1/src/Util/utils.h diff --git a/code/src/stage1/main.c b/code/stage1/src/main.c similarity index 100% rename from code/src/stage1/main.c rename to code/stage1/src/main.c diff --git a/code/src/main.sh b/code/stage1/src/main.sh similarity index 100% rename from code/src/main.sh rename to code/stage1/src/main.sh diff --git a/code/test/stage1/Algorithm/t.compute_coefficients.c b/code/stage1/test/Algorithm/t.compute_coefficients.c similarity index 100% rename from code/test/stage1/Algorithm/t.compute_coefficients.c rename to code/stage1/test/Algorithm/t.compute_coefficients.c diff --git a/code/test/stage1/Algorithm/t.pam.c b/code/stage1/test/Algorithm/t.pam.c similarity index 100% rename from code/test/stage1/Algorithm/t.pam.c rename to code/stage1/test/Algorithm/t.pam.c diff --git a/code/test/stage1/CMakeLists.txt b/code/stage1/test/CMakeLists.txt similarity index 100% rename from code/test/stage1/CMakeLists.txt rename to code/stage1/test/CMakeLists.txt diff --git a/code/test/stage1/MPI_Communication/t.pack.c b/code/stage1/test/MPI_Communication/t.pack.c similarity index 94% rename from code/test/stage1/MPI_Communication/t.pack.c rename to code/stage1/test/MPI_Communication/t.pack.c index 125fd47..6692af5 100644 --- a/code/test/stage1/MPI_Communication/t.pack.c +++ b/code/stage1/test/MPI_Communication/t.pack.c @@ -9,7 +9,7 @@ void t_pack1() { Work_t* work = (Work_t*)malloc(sizeof(Work_t)); - work->inputFileName = "../data/inputTest.bin"; + work->inputFileName = "../tdata/inputTest.bin"; work->nbSeries = 5; uint32_t ranks[] = { @@ -27,9 +27,9 @@ void t_pack1() // Hard-coded expected packed work unsigned char expectedPackedWork[] = { - // --> ../data/inputTest.bin + // --> ../tdata/inputTest.bin 46,46,47,100,97,116,97,47,105,110,112,117,116,84,101,115,116,46,98,105,110, - // continue with 256 - strlen("../data/inputTest.bin") zeros... + // continue with 256 - strlen("../tdata/inputTest.bin") zeros... 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, diff --git a/code/test/stage1/MPI_Communication/t.unpack.c b/code/stage1/test/MPI_Communication/t.unpack.c similarity index 93% rename from code/test/stage1/MPI_Communication/t.unpack.c rename to code/stage1/test/MPI_Communication/t.unpack.c index 90e5ae1..caf0e8d 100644 --- a/code/test/stage1/MPI_Communication/t.unpack.c +++ b/code/stage1/test/MPI_Communication/t.unpack.c @@ -12,9 +12,9 @@ void t_unpack1() // Hard-coded packed work unsigned char packedWork[] = { - // --> ../data/inputTest.bin + // --> ../tdata/inputTest.bin 46,46,47,100,97,116,97,47,105,110,112,117,116,84,101,115,116,46,98,105,110, - // continue with 256 - strlen("../data/inputTest.bin") zeros... + // continue with 256 - strlen("../tdata/inputTest.bin") zeros... 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -35,7 +35,7 @@ void t_unpack1() uint32_t nbSeriesInChunk = 7; Work_t* work = unpack_work(packedWork, nbSeriesInChunk); - LUT_ASSERT(strcmp(work->inputFileName, "../data/inputTest.bin") == 0); + LUT_ASSERT(strcmp(work->inputFileName, "../tdata/inputTest.bin") == 0); LUT_ASSERT(work->nbSeries == 5); uint32_t ranks[] = { diff --git a/code/test/stage1/TimeSeries/t.deserialize.c b/code/stage1/test/TimeSeries/t.deserialize.c similarity index 96% rename from code/test/stage1/TimeSeries/t.deserialize.c rename to code/stage1/test/TimeSeries/t.deserialize.c index 22e0956..3a6413d 100644 --- a/code/test/stage1/TimeSeries/t.deserialize.c +++ b/code/stage1/test/TimeSeries/t.deserialize.c @@ -8,7 +8,7 @@ void t_deserialize1() { // decode sample_byCols.bin into the toy dataset (4 customers, 3 sample points) - const char* ifName = "../data/test/sample_byCols.bin"; + const char* ifName = "../tdata/test/sample_byCols.bin"; // check 'header' uint32_t nbSeries = get_nbSeries(ifName); @@ -52,7 +52,7 @@ void t_deserialize1() void t_deserialize2() { // decode sample_byRows.bin into the toy dataset (4 customers, 3 sample points) - const char* ifName = "../data/test/sample_byRows.bin"; + const char* ifName = "../tdata/test/sample_byRows.bin"; // check 'header' uint32_t nbSeries = get_nbSeries(ifName); diff --git a/code/test/stage1/TimeSeries/t.serialize.c b/code/stage1/test/TimeSeries/t.serialize.c similarity index 71% rename from code/test/stage1/TimeSeries/t.serialize.c rename to code/stage1/test/TimeSeries/t.serialize.c index 1dda321..6003c67 100644 --- a/code/test/stage1/TimeSeries/t.serialize.c +++ b/code/stage1/test/TimeSeries/t.serialize.c @@ -16,9 +16,9 @@ static void checkFilesEqual(const char* fileName1, const char* fileName2) void t_serialize1() { - const char* csvIfName = "../data/test/sample_byCols.csv"; - const char* binaryIfName = "../data/test/sample_byCols.bin"; - const char* tmpBinaryIfName = "../data/test/sample_byCols.tmp.bin"; + const char* csvIfName = "../tdata/test/sample_byCols.csv"; + const char* binaryIfName = "../tdata/test/sample_byCols.bin"; + const char* tmpBinaryIfName = "../tdata/test/sample_byCols.tmp.bin"; // serialize text file into a temporary binary file serialize_byCols(csvIfName, tmpBinaryIfName, 0); @@ -32,9 +32,9 @@ void t_serialize1() void t_serialize2() { - const char* csvIfName = "../data/test/sample_byRows.csv"; - const char* binaryIfName = "../data/test/sample_byRows.bin"; - const char* tmpBinaryIfName = "../data/test/sample_byRows.tmp.bin"; + const char* csvIfName = "../tdata/test/sample_byRows.csv"; + const char* binaryIfName = "../tdata/test/sample_byRows.bin"; + const char* tmpBinaryIfName = "../tdata/test/sample_byRows.tmp.bin"; // serialize text file into a temporary binary file serialize_byRows(csvIfName, tmpBinaryIfName, 0); diff --git a/code/test/stage1/Util/t.rng.c b/code/stage1/test/Util/t.rng.c similarity index 100% rename from code/test/stage1/Util/t.rng.c rename to code/stage1/test/Util/t.rng.c diff --git a/code/test/stage1/Util/t.utils.c b/code/stage1/test/Util/t.utils.c similarity index 89% rename from code/test/stage1/Util/t.utils.c rename to code/stage1/test/Util/t.utils.c index 254ef00..1abed91 100644 --- a/code/test/stage1/Util/t.utils.c +++ b/code/stage1/test/Util/t.utils.c @@ -8,7 +8,7 @@ //integers void t_utils1() { - FILE* file = fopen("../data/test/integers.txt", "rb"); + FILE* file = fopen("../tdata/test/integers.txt", "rb"); int64_t x; readInt(file, &x); LUT_ASSERT(x == 1234); @@ -28,7 +28,7 @@ void t_utils1() //reals void t_utils2() { - FILE* file = fopen("../data/test/reals.txt", "rb"); + FILE* file = fopen("../tdata/test/reals.txt", "rb"); Real x, tol = 1e-10; readReal(file, &x); LUT_ASSERT(fabs(x - 1234.056) < tol); diff --git a/code/test/lut.h b/code/stage1/test/lut.h similarity index 100% rename from code/test/lut.h rename to code/stage1/test/lut.h diff --git a/code/test/stage1/main.c b/code/stage1/test/main.c similarity index 100% rename from code/test/stage1/main.c rename to code/stage1/test/main.c diff --git a/code/data/test/integers.txt b/code/stage1/test/tdata/integers.txt similarity index 100% rename from code/data/test/integers.txt rename to code/stage1/test/tdata/integers.txt diff --git a/code/data/test/reals.txt b/code/stage1/test/tdata/reals.txt similarity index 100% rename from code/data/test/reals.txt rename to code/stage1/test/tdata/reals.txt diff --git a/code/data/test/sample_byCols.bin b/code/stage1/test/tdata/sample_byCols.bin similarity index 100% rename from code/data/test/sample_byCols.bin rename to code/stage1/test/tdata/sample_byCols.bin diff --git a/code/data/test/sample_byCols.csv b/code/stage1/test/tdata/sample_byCols.csv similarity index 100% rename from code/data/test/sample_byCols.csv rename to code/stage1/test/tdata/sample_byCols.csv diff --git a/code/data/test/sample_byRows.bin b/code/stage1/test/tdata/sample_byRows.bin similarity index 100% rename from code/data/test/sample_byRows.bin rename to code/stage1/test/tdata/sample_byRows.bin diff --git a/code/data/test/sample_byRows.csv b/code/stage1/test/tdata/sample_byRows.csv similarity index 100% rename from code/data/test/sample_byRows.csv rename to code/stage1/test/tdata/sample_byRows.csv diff --git a/code/src/stage2/.gitkeep b/code/stage2/src/.gitkeep similarity index 100% rename from code/src/stage2/.gitkeep rename to code/stage2/src/.gitkeep diff --git a/code/test/stage2/.gitkeep b/code/stage2/test/.gitkeep similarity index 100% rename from code/test/stage2/.gitkeep rename to code/stage2/test/.gitkeep diff --git a/communication/.gitignore b/communication/.gitignore new file mode 100644 index 0000000..bb8be15 --- /dev/null +++ b/communication/.gitignore @@ -0,0 +1,8 @@ +#ignore all files produced by LaTeX compilation +*.aux +*.log +*.nav +*.snm +*.toc +*.out +*.pdf