From: Augustin Degomme Date: Thu, 3 Mar 2022 16:27:31 +0000 (+0100) Subject: SMPI. RMA: get rid of the s4u barrier, use an MPI one instead. X-Git-Tag: v3.31~235 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/40acbaccded3b4765650fea465409729f99ddefd SMPI. RMA: get rid of the s4u barrier, use an MPI one instead. --- diff --git a/src/smpi/include/smpi_win.hpp b/src/smpi/include/smpi_win.hpp index f020e8648c..5e18418b01 100644 --- a/src/smpi/include/smpi_win.hpp +++ b/src/smpi/include/smpi_win.hpp @@ -28,7 +28,6 @@ class Win : public F2C, public Keyval { MPI_Comm comm_; std::vector requests_; s4u::MutexPtr mut_ = s4u::Mutex::create(); - s4u::Barrier* bar_ = nullptr; std::vector connected_wins_; std::string name_; int opened_ = 0; diff --git a/src/smpi/mpi/smpi_win.cpp b/src/smpi/mpi/smpi_win.cpp index 57026f0c38..765d92f400 100644 --- a/src/smpi/mpi/smpi_win.cpp +++ b/src/smpi/mpi/smpi_win.cpp @@ -53,9 +53,6 @@ Win::Win(void* base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, if(info!=MPI_INFO_NULL) info->ref(); connected_wins_[rank_] = this; - if(rank_==0){ - bar_ = new s4u::Barrier(comm->size()); - } errhandler_->ref(); comm->add_rma_win(this); comm->ref(); @@ -63,16 +60,13 @@ Win::Win(void* base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, colls::allgather(&connected_wins_[rank_], sizeof(MPI_Win), MPI_BYTE, connected_wins_.data(), sizeof(MPI_Win), MPI_BYTE, comm); - colls::bcast(&bar_, sizeof(s4u::Barrier*), MPI_BYTE, 0, comm); - colls::barrier(comm); this->add_f(); } Win::~Win(){ //As per the standard, perform a barrier to ensure every async comm is finished - bar_->wait(); - + colls::barrier(comm_); flush_local_all(); if (info_ != MPI_INFO_NULL) @@ -85,9 +79,6 @@ Win::~Win(){ colls::barrier(comm_); Comm::unref(comm_); - if (rank_ == 0) - delete bar_; - if (allocated_) xbt_free(base_); @@ -182,7 +173,7 @@ int Win::fence(int assert) opened_++; if (not (assert & MPI_MODE_NOPRECEDE)) { // This is not the first fence => finalize what came before - bar_->wait(); + colls::barrier(comm_); flush_local_all(); count_=0; } @@ -190,8 +181,7 @@ int Win::fence(int assert) if (assert & MPI_MODE_NOSUCCEED) // there should be no ops after this one, tell we are closed. opened_=0; assert_ = assert; - - bar_->wait(); + colls::barrier(comm_); XBT_DEBUG("Leaving fence"); return MPI_SUCCESS;