Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill an external dependency that was for stateful MC
[simgrid.git] / src / smpi / include / smpi_win.hpp
index 5e18418b01351d32991ec99b8fab95cffda749e4..436bd279a7da8628239ed4a124e0f75d9eb3b9e4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2022. The SimGrid Team.
+/* Copyright (c) 2010-2023. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -16,8 +16,7 @@
 #include <vector>
 #include <list>
 
-namespace simgrid{
-namespace smpi{
+namespace simgrid::smpi {
 
 class Win : public F2C, public Keyval {
   void* base_;
@@ -28,6 +27,7 @@ class Win : public F2C, public Keyval {
   MPI_Comm comm_;
   std::vector<MPI_Request> requests_;
   s4u::MutexPtr mut_ = s4u::Mutex::create();
+  s4u::BarrierPtr bar_;
   std::vector<MPI_Win> connected_wins_;
   std::string name_;
   int opened_               = 0;
@@ -52,11 +52,11 @@ public:
   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;
+  static int del(Win* win);
   int attach (void *base, MPI_Aint size);
   int detach (const void *base);
   void get_name(char* name, int* length) const;
-  std::string name() const override {return name_.empty() ? std::string("MPI_Win") : name_;}
+  std::string name() const override { return name_.empty() ? "MPI_Win" : name_; }
   void get_group( MPI_Group* group);
   void set_name(const char* name);
   int rank() const;
@@ -101,8 +101,6 @@ public:
   void set_errhandler( MPI_Errhandler errhandler);
 };
 
-
-}
-}
+} // namespace simgrid::smpi
 
 #endif