Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix request and coll failing tests
[simgrid.git] / src / smpi / mpi / smpi_datatype.cpp
index 2e79a32..a22b3d4 100644 (file)
@@ -79,9 +79,9 @@ CREATE_MPI_DATATYPE(MPI_REAL4, 39, float);
 CREATE_MPI_DATATYPE(MPI_REAL8, 40, double);
 CREATE_MPI_DATATYPE(MPI_REAL16, 41, long double);
 CREATE_MPI_DATATYPE_NULL(MPI_DATATYPE_NULL, -1);
-CREATE_MPI_DATATYPE_NULL(MPI_COMPLEX8, 42);
-CREATE_MPI_DATATYPE_NULL(MPI_COMPLEX16, 43);
-CREATE_MPI_DATATYPE_NULL(MPI_COMPLEX32, 44);
+CREATE_MPI_DATATYPE(MPI_COMPLEX8, 42, float_float);
+CREATE_MPI_DATATYPE(MPI_COMPLEX16, 43, double_double);
+CREATE_MPI_DATATYPE(MPI_COMPLEX32, 44, double_double);
 CREATE_MPI_DATATYPE(MPI_INTEGER1, 45, int);
 CREATE_MPI_DATATYPE(MPI_INTEGER2, 46, int16_t);
 CREATE_MPI_DATATYPE(MPI_INTEGER4, 47, int32_t);
@@ -129,8 +129,6 @@ Datatype::Datatype(Datatype *datatype, int* ret) : name_(nullptr), size_(datatyp
 {
   flags_ &= ~DT_FLAG_PREDEFINED;
   *ret = MPI_SUCCESS;
-  if(datatype->name_)
-    name_ = xbt_strdup(datatype->name_);
     
   if (not datatype->attributes()->empty()) {
     int flag=0;
@@ -240,8 +238,12 @@ int Datatype::extent(MPI_Aint * lb, MPI_Aint * extent){
 }
 
 void Datatype::get_name(char* name, int* length){
-  *length = strlen(name_);
-  strncpy(name, name_, *length+1);
+  if(name_!=nullptr){
+    *length = strlen(name_);
+    strncpy(name, name_, *length+1);
+  }else{
+    *length = 0;
+  }
 }
 
 void Datatype::set_name(const char* name){