Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
proper use of the HAVE_TRACING variable defined by Cmake through -Dtracing=on
[simgrid.git] / src / smpi / smpi_mpi_dt.c
index 672a5f8..f2453c0 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$tag */
 
 /* smpi_mpi_dt.c -- MPI primitives to handle datatypes                        */
+
 /* Note: a very incomplete implementation                                     */
 
 /* Copyright (c) 2009 Stephane Genaud.                                        */
@@ -40,11 +40,11 @@ typedef struct s_smpi_mpi_datatype {
 
 //The following are datatypes for the MPI functions MPI_MAXLOC and MPI_MINLOC.
 typedef struct { float       value; int index;} float_int;
-typedef struct { long        value; int index;} long_int ; 
+typedef struct { long        value; int index;} long_int ;
 typedef struct { double      value; int index;} double_int;
 typedef struct { short       value; int index;} short_int;
 typedef struct { int         value; int index;} int_int;
-typedef struct { long double value; int index;} long_double_int; 
+typedef struct { long double value; int index;} long_double_int;
 
 // Predefined data types
 CREATE_MPI_DATATYPE(MPI_CHAR,                  char);
@@ -77,7 +77,12 @@ CREATE_MPI_DATATYPE(MPI_C_LONG_DOUBLE_COMPLEX, long double _Complex);
 CREATE_MPI_DATATYPE(MPI_AINT,                  MPI_Aint);
 CREATE_MPI_DATATYPE(MPI_OFFSET,                MPI_Offset);
 
-CREATE_MPI_DATATYPE(MPI_FLOAT_INT,                float_int);
+CREATE_MPI_DATATYPE(MPI_FLOAT_INT,             float_int);
+CREATE_MPI_DATATYPE(MPI_LONG_INT,              long_int);
+CREATE_MPI_DATATYPE(MPI_DOUBLE_INT,            double_int);
+CREATE_MPI_DATATYPE(MPI_SHORT_INT,             short_int);
+CREATE_MPI_DATATYPE(MPI_2INT,                  int_int);
+CREATE_MPI_DATATYPE(MPI_LONG_DOUBLE_INT,       long_double_int);
 
 
 size_t smpi_datatype_size(MPI_Datatype datatype) {
@@ -117,8 +122,8 @@ int smpi_datatype_copy(void* sendbuf, int sendcount, MPI_Datatype sendtype, void
    memcpy(recvbuf, sendbuf, smpi_datatype_size(sendtype) * count);
    retval = sendcount > recvcount ? MPI_ERR_TRUNCATE : MPI_SUCCESS;
  } else {
-   /* FIXME:  cases 
-    * - If receive packed. 
+   /* FIXME:  cases
+    * - If receive packed.
     * - If send packed
     * to be treated once we have the MPI_Pack things ...
     **/
@@ -176,7 +181,7 @@ static void max_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
     APPLY_FUNC(a, b, length, long double, MAX_OP);
   }
 }
+
 static void min_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
   if(*datatype == MPI_SHORT) {
     APPLY_FUNC(a, b, length, short, MIN_OP);
@@ -198,7 +203,7 @@ static void min_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
     APPLY_FUNC(a, b, length, long double, MIN_OP);
   }
 }
+
 static void sum_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
   if(*datatype == MPI_SHORT) {
     APPLY_FUNC(a, b, length, short, SUM_OP);
@@ -226,7 +231,7 @@ static void sum_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
     APPLY_FUNC(a, b, length, long double _Complex, SUM_OP);
   }
 }
+
 static void prod_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
   if(*datatype == MPI_SHORT) {
     APPLY_FUNC(a, b, length, short, PROD_OP);
@@ -254,7 +259,7 @@ static void prod_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
     APPLY_FUNC(a, b, length, long double _Complex, PROD_OP);
   }
 }
+
 static void land_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
   if(*datatype == MPI_SHORT) {
     APPLY_FUNC(a, b, length, short, LAND_OP);
@@ -272,7 +277,7 @@ static void land_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
     APPLY_FUNC(a, b, length, _Bool, LAND_OP);
   }
 }
+
 static void lor_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
   if(*datatype == MPI_SHORT) {
     APPLY_FUNC(a, b, length, short, LOR_OP);
@@ -290,7 +295,7 @@ static void lor_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
     APPLY_FUNC(a, b, length, _Bool, LOR_OP);
   }
 }
+
 static void lxor_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
   if(*datatype == MPI_SHORT) {
     APPLY_FUNC(a, b, length, short, LXOR_OP);
@@ -308,7 +313,7 @@ static void lxor_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
     APPLY_FUNC(a, b, length, _Bool, LXOR_OP);
   }
 }
+
 static void band_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
   if(*datatype == MPI_SHORT) {
     APPLY_FUNC(a, b, length, short, BAND_OP);
@@ -326,7 +331,7 @@ static void band_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
     APPLY_FUNC(a, b, length, uint8_t, BAND_OP);
   }
 }
+
 static void bor_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
   if(*datatype == MPI_SHORT) {
     APPLY_FUNC(a, b, length, short, BOR_OP);
@@ -344,7 +349,7 @@ static void bor_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
     APPLY_FUNC(a, b, length, uint8_t, BOR_OP);
   }
 }
+
 static void bxor_func(void* a, void* b, int* length, MPI_Datatype* datatype) {
   if(*datatype == MPI_SHORT) {
     APPLY_FUNC(a, b, length, short, BXOR_OP);