Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
keep track of which datatype was duplicated, to be able to match with it later
[simgrid.git] / src / smpi / include / smpi_datatype.hpp
index 294e617..7bd716a 100644 (file)
@@ -109,6 +109,7 @@ class Datatype : public F2C, public Keyval{
   int flags_;
   int refcount_ = 1;
   std::unique_ptr<Datatype_contents> contents_ = nullptr;
+  MPI_Datatype duplicated_datatype_ = MPI_DATATYPE_NULL;
 
 protected:
   template <typename... Args> void set_contents(Args&&... args)
@@ -127,13 +128,13 @@ public:
   Datatype(const Datatype&) = delete;
   Datatype& operator=(const Datatype&) = delete;
   ~Datatype() override;
-
-  const char* name() const { return name_.c_str(); }
+  std::string name() const override {return name_.empty() ? std::string("MPI_Datatype") : name_;}
   size_t size() const { return size_; }
   MPI_Aint lb() const { return lb_; }
   MPI_Aint ub() const { return ub_; }
   int flags() const { return flags_; }
   int refcount() const { return refcount_; }
+  MPI_Datatype duplicated_datatype() const { return duplicated_datatype_; }
 
   void ref();
   static void unref(MPI_Datatype datatype);