From 631bc9b9e226d64cbd1cf912d2ef48805334f7d4 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 26 Mar 2018 09:38:22 +0200 Subject: [PATCH] finish(done) already sets remains to 0 --- src/surf/cpu_interface.cpp | 3 --- src/surf/cpu_ti.cpp | 2 -- src/surf/network_cm02.cpp | 1 - 3 files changed, 6 deletions(-) diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index fe032014ef..b3afee5483 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -34,9 +34,6 @@ void CpuModel::updateActionsStateLazy(double now, double /*delta*/) action->finish(kernel::resource::Action::State::done); XBT_CDEBUG(surf_kernel, "Action %p finished", action); - - /* set the remains to 0 due to precision problems when updating the remaining amount */ - action->set_remains(0); } if (TRACE_is_enabled()) { //defining the last timestamp that we can safely dump to trace file diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index c2b3eb6daf..5f63aa3b91 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -362,8 +362,6 @@ void CpuTiModel::updateActionsState(double now, double /*delta*/) CpuTiAction* action = static_cast(actionHeapPop()); XBT_DEBUG("Action %p: finish", action); action->finish(kernel::resource::Action::State::done); - /* set the remains to 0 due to precision problems when updating the remaining amount */ - action->set_remains(0); /* update remaining amount of all actions */ action->cpu_->updateRemainingAmount(surf_get_clock()); } diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index c458d31777..6e7e60b3d4 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -200,7 +200,6 @@ void NetworkCm02Model::updateActionsStateLazy(double now, double /*delta*/) // no need to communicate anymore // assume that flows that reached max_duration have remaining of 0 XBT_DEBUG("Action %p finished", action); - action->set_remains(0); action->finish(kernel::resource::Action::State::done); action->heapRemove(getActionHeap()); } -- 2.20.1