From 017abccc6d2baf4a39c08e9ebfe1fc402d12384b Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 7 Mar 2022 00:41:52 +0100 Subject: [PATCH] sonar fixes and little cleanups --- src/kernel/activity/BarrierImpl.hpp | 3 +-- src/kernel/activity/SemaphoreImpl.hpp | 3 +-- src/smpi/mpi/smpi_win.cpp | 2 +- teshsuite/smpi/MBI/CMakeLists.txt | 1 + 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/kernel/activity/BarrierImpl.hpp b/src/kernel/activity/BarrierImpl.hpp index 44736cd3ce..e34ba73ac6 100644 --- a/src/kernel/activity/BarrierImpl.hpp +++ b/src/kernel/activity/BarrierImpl.hpp @@ -46,7 +46,6 @@ class XBT_PUBLIC BarrierImpl { std::atomic_int_fast32_t refcount_{1}; s4u::Barrier piface_; unsigned int expected_actors_; - // std::vector arrived_actors_; std::deque ongoing_acquisitions_; static unsigned next_id_; unsigned id_ = next_id_++; @@ -55,7 +54,7 @@ class XBT_PUBLIC BarrierImpl { friend s4u::Barrier; public: - BarrierImpl(int expected_actors) : piface_(this), expected_actors_(expected_actors) {} + explicit BarrierImpl(int expected_actors) : piface_(this), expected_actors_(expected_actors) {} BarrierImpl(BarrierImpl const&) = delete; BarrierImpl& operator=(BarrierImpl const&) = delete; diff --git a/src/kernel/activity/SemaphoreImpl.hpp b/src/kernel/activity/SemaphoreImpl.hpp index a6a1613137..b817599bb2 100644 --- a/src/kernel/activity/SemaphoreImpl.hpp +++ b/src/kernel/activity/SemaphoreImpl.hpp @@ -82,8 +82,7 @@ public: delete sem; } } - unsigned get_id() { return id_; } - + unsigned get_id() const { return id_; } s4u::Semaphore& sem() { return piface_; } }; } // namespace activity diff --git a/src/smpi/mpi/smpi_win.cpp b/src/smpi/mpi/smpi_win.cpp index 8b0dfdacc0..65b034a88e 100644 --- a/src/smpi/mpi/smpi_win.cpp +++ b/src/smpi/mpi/smpi_win.cpp @@ -62,7 +62,7 @@ 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); if (MC_is_active() || MC_record_replay_is_active()){ - if (bar_.get() == 0) // First to arrive on the barrier + if (bar_.get() == nullptr) // First to arrive on the barrier bar_ = s4u::Barrier::create(comm->size()); bar_->wait(); }else{ diff --git a/teshsuite/smpi/MBI/CMakeLists.txt b/teshsuite/smpi/MBI/CMakeLists.txt index cd70deb2cc..40412691eb 100644 --- a/teshsuite/smpi/MBI/CMakeLists.txt +++ b/teshsuite/smpi/MBI/CMakeLists.txt @@ -57,6 +57,7 @@ if (enable_smpi_MBI_testsuite) SET_TESTS_PROPERTIES(mbi-${basefile} PROPERTIES DEPENDS mbi-${basefile}) SET_TESTS_PROPERTIES(mbi-${basefile} PROPERTIES DEPENDS simgrid-mc) endforeach() + file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/MBI/tmp) # Clean temp files if("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_HOME_DIRECTORY}") else() -- 2.20.1