Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Determine n_transitions on receiving side (and remove it from the message).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 20 Feb 2023 18:19:19 +0000 (19:19 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 24 Mar 2023 13:31:58 +0000 (14:31 +0100)
src/mc/api/RemoteApp.cpp
src/mc/remote/AppSide.cpp
src/mc/remote/mc_protocol.h

index aece6f8..00c6522 100644 (file)
@@ -105,14 +105,9 @@ void RemoteApp::get_actors_status(std::map<aid_t, ActorState>& whereto) const
   whereto.clear();
 
   for (const auto& actor : status) {
-    xbt_assert(actor.n_transitions == 0 || actor.n_transitions == actor.max_considered,
-               "If any transitions are serialized for an actor, it must match the "
-               "total number of transitions that can be considered for the actor "
-               "(currently %d), but only %d transition(s) was/were said to be encoded",
-               actor.max_considered, actor.n_transitions);
-
     std::vector<std::shared_ptr<Transition>> actor_transitions;
-    for (int times_considered = 0; times_considered < actor.n_transitions; times_considered++) {
+    int n_transitions = actor.enabled ? actor.max_considered : 0;
+    for (int times_considered = 0; times_considered < n_transitions; times_considered++) {
       s_mc_message_simcall_probe_one_t probe;
       ssize_t received = checker_side_->get_channel().receive(probe);
       xbt_assert(received >= 0, "Could not receive response to ACTORS_PROBE message (%s)", strerror(errno));
index 3299189..96f3b3e 100644 (file)
@@ -168,7 +168,6 @@ void AppSide::handle_actors_status() const
     status[i].aid            = aid;
     status[i].enabled        = mc::actor_is_enabled(actor);
     status[i].max_considered = actor->simcall_.observer_->get_max_consider();
-    status[i].n_transitions  = mc::actor_is_enabled(actor) ? status[i].max_considered : 0;
     i++;
   }
 
index caa405b..97b72ee 100644 (file)
@@ -110,10 +110,6 @@ struct s_mc_message_actors_status_one_t { // an array of `s_mc_message_actors_st
   aid_t aid;
   bool enabled;
   int max_considered;
-
-  // The total number of transitions that are serialized and associated with this actor.
-  // Enforced to be either `0` or the same as `max_considered`
-  int n_transitions;
 };
 
 // Answer from an actor to the question "what are you about to run?"