Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'dev-mailbox-clear' into 'master'
[simgrid.git] / src / smpi / include / smpi_win.hpp
index d7d1880..339b3c2 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2021. The SimGrid Team.
+/* Copyright (c) 2010-2022. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -11,6 +11,7 @@
 #include "smpi_errhandler.hpp"
 #include "smpi_f2c.hpp"
 #include "smpi_keyvals.hpp"
+#include "smpi_config.hpp"
 
 #include <vector>
 #include <list>
@@ -27,7 +28,7 @@ class Win : public F2C, public Keyval {
   MPI_Comm comm_;
   std::vector<MPI_Request> requests_;
   s4u::MutexPtr mut_ = s4u::Mutex::create();
-  s4u::Barrier* bar_ = nullptr;
+  s4u::BarrierPtr bar_;
   std::vector<MPI_Win> connected_wins_;
   std::string name_;
   int opened_               = 0;
@@ -41,7 +42,7 @@ class Win : public F2C, public Keyval {
   int mode_ = 0; // exclusive or shared lock
   bool allocated_;
   bool dynamic_;
-  MPI_Errhandler errhandler_ = MPI_ERRORS_ARE_FATAL;
+  MPI_Errhandler errhandler_ = _smpi_cfg_default_errhandler_is_error ? MPI_ERRORS_ARE_FATAL : MPI_ERRORS_RETURN;
 
 public:
   static std::unordered_map<int, smpi_key_elem> keyvals_;
@@ -52,7 +53,7 @@ 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;