X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=code%2Fsrc%2Fstage1%2FMPI_Communication%2Fpack.c;fp=code%2Fsrc%2Fstage1%2FMPI_Communication%2Fpack.c;h=0000000000000000000000000000000000000000;hb=4b7107ce2a0bb77b5b65a9b0617192b0a07fda29;hp=a7570b9814d54c7a076d805e4cc6bc1e797b2960;hpb=311c5c078a9fc8ec6bb449fa685dbb1657d75d39;p=epclust.git diff --git a/code/src/stage1/MPI_Communication/pack.c b/code/src/stage1/MPI_Communication/pack.c deleted file mode 100644 index a7570b9..0000000 --- a/code/src/stage1/MPI_Communication/pack.c +++ /dev/null @@ -1,60 +0,0 @@ -#include -#include "Util/types.h" -#include "Util/utils.h" - -// serialize a Work_t object into a bytes string -void pack_work(Work_t* work, uint32_t nbSeriesInChunk, Byte* packedWork) -{ - uint32_t index = 0; - - while (work->inputFileName[index] != 0) - { - packedWork[index] = work->inputFileName[index]; - index++; - } - // complete with zeros - while (index < NCHAR_FNAME) - packedWork[index++] = 0; - - write_int(work->nbSeries, 4, packedWork + index); - index += 4; - - for (uint32_t i = 0; i < work->nbSeries; i++) - { - write_int(work->ranks[i], 4, packedWork + index); - index += 4; - } - // complete with zeros - for (uint32_t i = 0; i < nbSeriesInChunk - work->nbSeries; i++) - { - write_int(0, 4, packedWork + index); - index += 4; - } - - write_int(work->nbClusters, 4, packedWork + index); - index += 4; - write_int(work->clustOnMedoids, 4, packedWork + index); - index += 4; - write_int(work->p_for_dissims, 4, packedWork + index); -} - -// serialize a Result_t object into a bytes string -void pack_result(Result_t* result, Byte* packedResult) -{ - uint32_t index = 0; - - write_int(result->nbClusters, 4, packedResult); - index += 4; - - for (uint32_t i = 0; i < result->nbClusters; i++) - { - write_int(result->medoids_ID[i], 4, packedResult + index); - index += 4; - } - - for (uint32_t i = 0; i < result->nbClusters; i++) - { - write_int(result->medoids_ranks[i], 4, packedResult + index); - index += 4; - } -}