X-Git-Url: https://git.auder.net/img/rock_paper_scissors_lizard_spock.gif?a=blobdiff_plain;ds=inline;f=old_C_code%2Fstage1%2Fsrc%2FMPI_Communication%2Fpack.c;fp=old_C_code%2Fstage1%2Fsrc%2FMPI_Communication%2Fpack.c;h=0000000000000000000000000000000000000000;hb=62deb4244895a20a35397dfb062f0b9fe94c5012;hp=8cb7b4f166f0c4d2fedbbd76acee01127b9e4480;hpb=3eef8d3df59ded9a281cff51f79fe824198a7427;p=epclust.git diff --git a/old_C_code/stage1/src/MPI_Communication/pack.c b/old_C_code/stage1/src/MPI_Communication/pack.c deleted file mode 100644 index 8cb7b4f..0000000 --- a/old_C_code/stage1/src/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, packedWork + index); - index += 4; - - for (uint32_t i = 0; i < work->nbSeries; i++) - { - write_int(work->ranks[i], packedWork + index); - index += 4; - } - // complete with zeros - for (uint32_t i = 0; i < nbSeriesInChunk - work->nbSeries; i++) - { - write_int(0, packedWork + index); - index += 4; - } - - write_int(work->nbClusters, packedWork + index); - index += 4; - write_int(work->clustOnMedoids, packedWork + index); - index += 4; - write_int(work->p_for_dissims, 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, packedResult); - index += 4; - - for (uint32_t i = 0; i < result->nbClusters; i++) - { - write_int(result->medoids_ID[i], packedResult + index); - index += 4; - } - - for (uint32_t i = 0; i < result->nbClusters; i++) - { - write_int(result->medoids_ranks[i], packedResult + index); - index += 4; - } -}