Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Replace README.git by a badge stating that we welcome PRs
[simgrid.git] / src / kernel / activity / ExecImpl.cpp
index 9cb7149ab2e0cb15debbdd22ce5f1606cbf14a98..ea4995d995163d476db9dbb4a760f9f6b5d05af0 100644 (file)
@@ -86,6 +86,12 @@ void simgrid::kernel::activity::ExecImpl::set_priority(double priority)
     surf_action_->set_priority(priority);
 }
 
+void simgrid::kernel::activity::ExecImpl::set_category(std::string category)
+{
+  if (surf_action_)
+    surf_action_->set_category(category);
+}
+
 void simgrid::kernel::activity::ExecImpl::post()
 {
   if (host_ && host_->is_off()) { /* FIXME: handle resource failure for parallel tasks too */
@@ -102,6 +108,8 @@ void simgrid::kernel::activity::ExecImpl::post()
     state_ = SIMIX_DONE;
   }
 
+  on_completion(this);
+
   if (surf_action_) {
     surf_action_->unref();
     surf_action_ = nullptr;
@@ -111,7 +119,6 @@ void simgrid::kernel::activity::ExecImpl::post()
     timeout_detector_ = nullptr;
   }
 
-  on_completion(this);
   /* If there are simcalls associated with the synchro, then answer them */
   if (not simcalls_.empty())
     SIMIX_execution_finish(this);