FIX: C code (double, float, ...) + wrapper (read/write data, get medoids)
[epclust.git] / code / stage1 / src / MPI_Communication / unpack.c
index de51270..c0f7e3c 100644 (file)
@@ -20,23 +20,23 @@ Work_t* unpack_work(Byte* packedWork, uint32_t nbSeriesInChunk)
 
        index = NCHAR_FNAME;
 
-       uint32_t nbSeries = work->nbSeries = bInt_to_uint(packedWork + index, 4);
+       uint32_t nbSeries = work->nbSeries = bInt_to_uint(packedWork + index);
        index += 4;
 
        work->ranks = (uint32_t*) malloc(nbSeries * sizeof(uint32_t));
        for (uint32_t i = 0; i < nbSeries; i++)
        {
-               work->ranks[i] = bInt_to_uint(packedWork + index, 4);
+               work->ranks[i] = bInt_to_uint(packedWork + index);
                index += 4;
        }
        // shift over the zeros
        index += 4 * (nbSeriesInChunk - nbSeries);
 
-       work->nbClusters = bInt_to_uint(packedWork + index, 4);
+       work->nbClusters = bInt_to_uint(packedWork + index);
        index += 4;
-       work->clustOnMedoids = bInt_to_uint(packedWork + index, 4);
+       work->clustOnMedoids = bInt_to_uint(packedWork + index);
        index += 4;
-       work->p_for_dissims = bInt_to_uint(packedWork + index, 4);
+       work->p_for_dissims = bInt_to_uint(packedWork + index);
 
        return work;
 }
@@ -47,20 +47,20 @@ Result_t* unpack_result(Byte* packedResult)
        Result_t* result = (Result_t*) malloc(sizeof(Result_t));
        uint32_t index = 0;
 
-       uint32_t nbClusters = result->nbClusters = bInt_to_uint(packedResult, 4);
+       uint32_t nbClusters = result->nbClusters = bInt_to_uint(packedResult);
        index += 4;
 
        result->medoids_ID = (uint32_t*) malloc(nbClusters * sizeof(uint32_t));
        for (uint32_t i = 0; i < nbClusters; i++)
        {
-               result->medoids_ID[i] = bInt_to_uint(packedResult + index, 4);
+               result->medoids_ID[i] = bInt_to_uint(packedResult + index);
                index += 4;
        }
 
        result->medoids_ranks = (uint32_t*) malloc(nbClusters * sizeof(uint32_t));
        for (uint32_t i = 0; i < nbClusters; i++)
        {
-               result->medoids_ranks[i] = bInt_to_uint(packedResult + index, 4);
+               result->medoids_ranks[i] = bInt_to_uint(packedResult + index);
                index += 4;
        }