Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use a std::unique_ptr, and avoid explicit new/delete.
[simgrid.git] / src / smpi / include / smpi_request.hpp
index 547d93b..a91b6ab 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2022. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -30,7 +30,7 @@ class Request : public F2C {
   void* old_buf_;
   /* this is especially for derived datatypes that we need to serialize/unserialize.
    * It let us know how to unserialize at the end of the communication */
-  MPI_Datatype old_type_;
+  MPI_Datatype type_;
   size_t size_;
   aid_t src_;
   aid_t dst_;
@@ -40,6 +40,7 @@ class Request : public F2C {
   aid_t real_src_;
   int real_tag_;
   bool truncated_;
+  bool unmatched_types_;
   size_t real_size_;
   MPI_Comm comm_;
   simgrid::kernel::activity::ActivityImplPtr action_;
@@ -47,10 +48,13 @@ class Request : public F2C {
   bool detached_;
   MPI_Request detached_sender_;
   int refcount_;
+  unsigned int message_id_;
   MPI_Op op_;
   std::unique_ptr<smpi_mpi_generalized_request_funcs_t> generalized_funcs;
   std::vector<MPI_Request> nbc_requests_;
+  s4u::Host* src_host_ = nullptr; //!< save simgrid's source host since it can finished before the recv
   static bool match_common(MPI_Request req, MPI_Request sender, MPI_Request receiver);
+  static bool match_types(MPI_Datatype stype, MPI_Datatype rtype);
 
 public:
   Request() = default;
@@ -65,7 +69,7 @@ public:
   int flags() const { return flags_; }
   bool detached() const { return detached_; }
   std::string name() const override { return std::string("MPI_Request"); }
-  MPI_Datatype type() const { return old_type_; }
+  MPI_Datatype type() const { return type_; }
   void print_request(const char* message) const;
   void start();
   void cancel();