From 13c44fd940bdb0559e28208d47c130353895b13d Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 31 Mar 2022 11:43:58 +0200 Subject: [PATCH] Dead code elimination. --- src/kernel/lmm/System.cpp | 8 +------- src/kernel/lmm/System.hpp | 1 - src/mc/explo/CommunicationDeterminismChecker.cpp | 2 -- src/surf/network_cm02.cpp | 7 ++----- 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/kernel/lmm/System.cpp b/src/kernel/lmm/System.cpp index 1df04f4e4b..fcf84f3b5b 100644 --- a/src/kernel/lmm/System.cpp +++ b/src/kernel/lmm/System.cpp @@ -758,12 +758,6 @@ double Constraint::get_usage() const return result; } -int Constraint::get_variable_amount() const -{ - return static_cast(std::count_if(std::begin(enabled_element_set_), std::end(enabled_element_set_), - [](const Element& elem) { return elem.consumption_weight > 0; })); -} - void Constraint::set_sharing_policy(SharingPolicy policy, const s4u::NonLinearResourceCb& cb) { xbt_assert(policy == SharingPolicy::NONLINEAR || not cb, @@ -774,4 +768,4 @@ void Constraint::set_sharing_policy(SharingPolicy policy, const s4u::NonLinearRe } // namespace lmm } // namespace kernel -} // namespace simgrid \ No newline at end of file +} // namespace simgrid diff --git a/src/kernel/lmm/System.hpp b/src/kernel/lmm/System.hpp index 9610b79741..72938254de 100644 --- a/src/kernel/lmm/System.hpp +++ b/src/kernel/lmm/System.hpp @@ -221,7 +221,6 @@ public: /** @brief Get the usage of the constraint after the last lmm solve */ double get_usage() const; - int get_variable_amount() const; /** @brief Sets the concurrency limit for this constraint */ void set_concurrency_limit(int limit) diff --git a/src/mc/explo/CommunicationDeterminismChecker.cpp b/src/mc/explo/CommunicationDeterminismChecker.cpp index 6e1bcbadca..bd4fa6ec5c 100644 --- a/src/mc/explo/CommunicationDeterminismChecker.cpp +++ b/src/mc/explo/CommunicationDeterminismChecker.cpp @@ -287,8 +287,6 @@ void CommDetExtension::handle_comm_pattern(const Transition* transition) switch (transition->type_) { case Transition::Type::COMM_SEND: - get_comm_pattern(transition); - break; case Transition::Type::COMM_RECV: get_comm_pattern(transition); break; diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 8d1b395fe7..010b39c11b 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -182,13 +182,10 @@ void NetworkCm02Model::update_actions_state_full(double /*now*/, double delta) auto& action = static_cast(*it); ++it; // increment iterator here since the following calls to action.finish() may invalidate it XBT_DEBUG("Something happened to action %p", &action); - double deltap = delta; if (action.latency_ > 0) { - if (action.latency_ > deltap) { - double_update(&action.latency_, deltap, sg_surf_precision); - deltap = 0.0; + if (action.latency_ > delta) { + double_update(&action.latency_, delta, sg_surf_precision); } else { - double_update(&deltap, action.latency_, sg_surf_precision); action.latency_ = 0.0; } if (action.latency_ <= 0.0 && not action.is_suspended()) -- 2.20.1