Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MC: simplification knowing that every visible transitions have an observer
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 19 Feb 2022 00:21:42 +0000 (01:21 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 19 Feb 2022 00:21:42 +0000 (01:21 +0100)
src/mc/api/State.cpp
src/mc/mc_base.cpp

index e4772d9..19c8b63 100644 (file)
@@ -68,14 +68,9 @@ void State::execute_next(int next)
 
   simgrid::mc::ActorState* actor_state = &actor_states_[aid];
   /* This actor is ready to be executed. Prepare its execution when simcall_handle will be called on it */
-  if (actor->simcall_.observer_ != nullptr) {
-    times_considered = actor_state->get_times_considered_and_inc();
-    if (actor->simcall_.mc_max_consider_ <= actor_state->get_times_considered())
-      actor_state->set_done();
-  } else {
-    times_considered = 0;
+  times_considered = actor_state->get_times_considered_and_inc();
+  if (actor->simcall_.mc_max_consider_ <= actor_state->get_times_considered())
     actor_state->set_done();
-  }
 
   executed_req_ = actor->simcall_;
 
index 236aab7..9ecb0de 100644 (file)
@@ -58,8 +58,9 @@ void execute_actors()
   engine->reset_actor_dynar();
   for (auto const& kv : engine->get_actor_list()) {
     auto actor = kv.second;
-    if (auto* observer = actor->simcall_.observer_)
-      actor->simcall_.mc_max_consider_ = observer->get_max_consider();
+    // Only visible requests remain at this point, and they all have an observer
+    actor->simcall_.mc_max_consider_ = actor->simcall_.observer_->get_max_consider();
+
     engine->add_actor_to_dynar(actor);
   }
 #endif