Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Some int -> bool conversions (+ use of existing macro).
[simgrid.git] / src / smpi / include / smpi_win.hpp
index b20bfa9..5a6f3a1 100644 (file)
@@ -31,23 +31,25 @@ class Win : public F2C, public Keyval {
   std::vector<MPI_Win> connected_wins_;
   std::string name_;
   int opened_               = 0;
-  MPI_Group group_          = MPI_GROUP_NULL;
+  MPI_Group src_group_      = MPI_GROUP_NULL; // for post/wait
+  MPI_Group dst_group_      = MPI_GROUP_NULL; // for start/complete
   int count_                = 0; // for ordering the accs
   s4u::MutexPtr lock_mut_   = s4u::Mutex::create();
   s4u::MutexPtr atomic_mut_ = s4u::Mutex::create();
   std::list<int> lockers_;
   int rank_; // to identify owner for barriers in MPI_COMM_WORLD
   int mode_ = 0; // exclusive or shared lock
-  int allocated_;
-  int dynamic_;
+  bool allocated_;
+  bool dynamic_;
   MPI_Errhandler errhandler_ = MPI_ERRORS_ARE_FATAL;
 
 public:
   static std::unordered_map<int, smpi_key_elem> keyvals_;
   static int keyval_id_;
 
-  Win(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, int allocated = 0, int dynamic = 0);
-  Win(MPI_Info info, MPI_Comm comm) : Win(MPI_BOTTOM, 0, 1, info, comm, 0, 1) {};
+  Win(void* base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, bool allocated = false,
+      bool dynamic = false);
+  Win(MPI_Info info, MPI_Comm comm) : Win(MPI_BOTTOM, 0, 1, info, comm, false, true){};
   Win(const Win&) = delete;
   Win& operator=(const Win&) = delete;
   ~Win() override;
@@ -59,7 +61,7 @@ public:
   void set_name(const char* name);
   int rank() const;
   MPI_Comm comm() const;
-  int dynamic() const;
+  bool dynamic() const;
   int start(MPI_Group group, int assert);
   int post(MPI_Group group, int assert);
   int complete();