X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0199ba108d66c94df94e4f044994e79efdece4b1..5ed37babb2fa9097abe82df299c0aa259ed84d5a:/src/smpi/include/smpi_win.hpp diff --git a/src/smpi/include/smpi_win.hpp b/src/smpi/include/smpi_win.hpp index d7d1880055..436bd279a7 100644 --- a/src/smpi/include/smpi_win.hpp +++ b/src/smpi/include/smpi_win.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2021. 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 @@ -11,12 +11,12 @@ #include "smpi_errhandler.hpp" #include "smpi_f2c.hpp" #include "smpi_keyvals.hpp" +#include "smpi_config.hpp" #include #include -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class Win : public F2C, public Keyval { void* base_; @@ -27,7 +27,7 @@ class Win : public F2C, public Keyval { MPI_Comm comm_; std::vector requests_; s4u::MutexPtr mut_ = s4u::Mutex::create(); - s4u::Barrier* bar_ = nullptr; + s4u::BarrierPtr bar_; std::vector connected_wins_; std::string name_; int opened_ = 0; @@ -41,7 +41,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 keyvals_; @@ -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