Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sanity check that mutex are empty when destroyed
[simgrid.git] / src / kernel / activity / ExecImpl.cpp
index d9badf2..a05e00c 100644 (file)
@@ -71,6 +71,7 @@ ExecImpl* ExecImpl::start()
   set_state(State::RUNNING);
   if (not MC_is_active() && not MC_record_replay_is_active()) {
     if (get_hosts().size() == 1) {
+      xbt_assert(not flops_amounts_.empty(), "Cannot start Exec: no flops_amount defined.");
       if (thread_count_ == 1) {
         model_action_ = get_host()->get_cpu()->execution_start(flops_amounts_.front(), bound_);
         model_action_->set_sharing_penalty(sharing_penalty_);
@@ -88,15 +89,6 @@ ExecImpl* ExecImpl::start()
     set_start_time(model_action_->get_start_time());
   }
 
-  /* Allow execs to fail if any their host fail (or any of their host for parallel execs) */
-  cb_id_ = s4u::Host::on_state_change.connect([this](s4u::Host const& h) {
-    if (not h.is_on() && get_state() == kernel::activity::State::RUNNING &&
-        std::find(get_hosts().begin(), get_hosts().end(), &h) != get_hosts().end()) {
-      set_state(kernel::activity::State::FAILED);
-      finish();
-    }
-  });
-
   XBT_DEBUG("Create execute synchro %p: %s", this, get_cname());
   return this;
 }
@@ -188,9 +180,6 @@ void ExecImpl::finish()
   if (get_actor() != nullptr)
     get_actor()->activities_.erase(this);
 
-  if (get_state() != State::FAILED && cb_id_ >= 0)
-    s4u::Host::on_state_change.disconnect(cb_id_);
-
   while (not simcalls_.empty()) {
     actor::Simcall* simcall = simcalls_.front();
     simcalls_.pop_front();
@@ -214,8 +203,6 @@ void ExecImpl::finish()
 void ExecImpl::reset()
 {
   clear_hosts();
-  bytes_amounts_.clear();
-  flops_amounts_.clear();
   set_start_time(-1.0);
 }