X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e64ba31b4d5eb5a498b22369c280832c85b80043..da1776809652a1706f96fff369684a43f251e084:/src/smpi/include/smpi_win.hpp diff --git a/src/smpi/include/smpi_win.hpp b/src/smpi/include/smpi_win.hpp index 595bfe8394..cb5ab79f98 100644 --- a/src/smpi/include/smpi_win.hpp +++ b/src/smpi/include/smpi_win.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2020. The SimGrid Team. +/* Copyright (c) 2010-2021. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -25,22 +25,23 @@ class Win : public F2C, public Keyval { int assert_ = 0; MPI_Info info_; MPI_Comm comm_; - std::vector *requests_; - s4u::MutexPtr mut_; - s4u::Barrier* bar_; - MPI_Win* connected_wins_; - char* name_; - int opened_; - MPI_Group group_; - int count_; //for ordering the accs - s4u::MutexPtr lock_mut_; - s4u::MutexPtr atomic_mut_; + std::vector requests_; + s4u::MutexPtr mut_ = s4u::Mutex::create(); + s4u::Barrier* bar_ = nullptr; + std::vector connected_wins_; + std::string name_; + int opened_ = 0; + 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 lockers_; int rank_; // to identify owner for barriers in MPI_COMM_WORLD - int mode_; // exclusive or shared lock + int mode_ = 0; // exclusive or shared lock int allocated_; int dynamic_; - MPI_Errhandler errhandler_; + MPI_Errhandler errhandler_ = MPI_ERRORS_ARE_FATAL; public: static std::unordered_map keyvals_; @@ -50,13 +51,15 @@ public: Win(MPI_Info info, MPI_Comm comm) : Win(MPI_BOTTOM, 0, 1, info, comm, 0, 1) {}; Win(const Win&) = delete; Win& operator=(const Win&) = delete; - ~Win(); + ~Win() override; 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_;} void get_group( MPI_Group* group); void set_name(const char* name); int rank() const; + MPI_Comm comm() const; int dynamic() const; int start(MPI_Group group, int assert); int post(MPI_Group group, int assert); @@ -91,7 +94,7 @@ public: int flush_local_all(); int finish_comms(); int finish_comms(int rank); - int shared_query(int rank, MPI_Aint* size, int* disp_unit, void* baseptr); + int shared_query(int rank, MPI_Aint* size, int* disp_unit, void* baseptr) const; MPI_Errhandler errhandler(); void set_errhandler( MPI_Errhandler errhandler); };