Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix GH#343
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 8 Mar 2021 21:54:49 +0000 (22:54 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 8 Mar 2021 21:59:47 +0000 (22:59 +0100)
- An exec that ends right when the timeout expires is actually done
- when the timeout_detector finished, change the state of the action of
the ExecImpl that owns this detector to FAILED. This will trigger
on_state_change for the right action and solve the issue on energy
logging of this issue.
- Side effect, more instrumentation is displayed in another example of
a ptask with timeout.

ChangeLog
examples/cpp/exec-ptask/s4u-exec-ptask.tesh
src/kernel/activity/ExecImpl.cpp

index 3e1a6ae..67accfc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,7 @@ Documentation:
 Fixed bugs (FG#.. -> FramaGit bugs; FG!.. -> FG merge requests)
  (FG: issues on Framagit; GF: issues on GForge; GH: issues on GitHub)
 - FG#37: Parallel tasks are limited to 1 core per host
+- GH#343: Wrong consumed energy when an exec timeouts
 
 ----------------------------------------------------------------------------
 
index b03213d..3061414 100644 (file)
@@ -11,6 +11,10 @@ $ ${bindir:=.}/s4u-exec-ptask ${platfdir}/energy_platform.xml --cfg=host/model:p
 > [300.000000] (0:maestro@) UNCAT HOST [0.000000 - 300.000000] MyHost3 speed_used 3333333.333333
 > [300.000000] (0:maestro@) UNCAT LINK [0.000000 - 300.000000] bus bandwidth_used 100000.000000
 > [300.000000] (1:test@MyHost1) We can do the same with a timeout of 10 seconds enabled.
+> [310.000000] (0:maestro@) UNCAT HOST [300.000000 - 310.000000] MyHost1 speed_used 3333333.333333
+> [310.000000] (0:maestro@) UNCAT HOST [300.000000 - 310.000000] MyHost2 speed_used 3333333.333333
+> [310.000000] (0:maestro@) UNCAT HOST [300.000000 - 310.000000] MyHost3 speed_used 3333333.333333
+> [310.000000] (0:maestro@) UNCAT LINK [300.000000 - 310.000000] bus bandwidth_used 100000.000000
 > [310.000000] (1:test@MyHost1) Caught the expected timeout exception.
 > [310.000000] (1:test@MyHost1) Then, build a parallel activity involving only computations (of different amounts) and no communication
 > [320.000000] (0:maestro@) UNCAT HOST [310.000000 - 320.000000] MyHost1 speed_used 30000000.000000
index 0e38011..e643483 100644 (file)
@@ -161,7 +161,12 @@ void ExecImpl::post()
     /* If the host running the synchro didn't fail, then the synchro was canceled */
     state_ = State::CANCELED;
   } else if (timeout_detector_ && timeout_detector_->get_state() == resource::Action::State::FINISHED) {
-    state_ = State::TIMEOUT;
+    if (surf_action_->get_remains() > 0.0) {
+      surf_action_->set_state(resource::Action::State::FAILED);
+      state_ = State::TIMEOUT;
+    } else {
+      state_ = State::DONE;
+    }
   } else {
     state_ = State::DONE;
   }