Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add Exec::setBound (and what lies beneath)
[simgrid.git] / src / kernel / activity / ExecImpl.cpp
index d233924..25dde5d 100644 (file)
@@ -11,7 +11,6 @@
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/cpu_interface.hpp"
 
-
 #include "simgrid/s4u/Host.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
@@ -32,6 +31,7 @@ simgrid::kernel::activity::ExecImpl::~ExecImpl()
     timeoutDetector->unref();
   XBT_DEBUG("Destroy exec %p", this);
 }
+
 void simgrid::kernel::activity::ExecImpl::suspend()
 {
   XBT_VERB("This exec is suspended (remain: %f)", surfAction_->getRemains());
@@ -54,6 +54,7 @@ double simgrid::kernel::activity::ExecImpl::remains()
 
   return surfAction_ ? surfAction_->getRemains() : 0;
 }
+
 double simgrid::kernel::activity::ExecImpl::remainingRatio()
 {
   if (host_ == nullptr) // parallel task: their remain is already between 0 and 1 (see comment in ExecImpl::remains())
@@ -62,6 +63,12 @@ double simgrid::kernel::activity::ExecImpl::remainingRatio()
     return surfAction_->getRemains() / surfAction_->getCost();
 }
 
+void simgrid::kernel::activity::ExecImpl::setBound(double bound)
+{
+  if (surfAction_)
+    surfAction_->setBound(bound);
+}
+
 void simgrid::kernel::activity::ExecImpl::post()
 {
   if (host_ && host_->isOff()) { /* FIXME: handle resource failure for parallel tasks too */
@@ -116,7 +123,6 @@ simgrid::kernel::activity::ExecImpl::migrate(simgrid::s4u::Host* to)
   return this;
 }
 
-
 /*************
  * Callbacks *
  *************/