Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
There's no need to compute the total transition count anymore.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 20 Feb 2023 18:15:17 +0000 (19:15 +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 66b7bca..aece6f8 100644 (file)
@@ -94,11 +94,6 @@ void RemoteApp::get_actors_status(std::map<aid_t, ActorState>& whereto) const
 
   // Message sanity checks
   xbt_assert(answer.count >= 0, "Received an ACTOR_STATUS_REPLY message with an actor count of '%d' < 0", answer.count);
-  xbt_assert(answer.transition_count >= 0, "Received an ACTOR_STATUS_REPLY message with transition_count '%d' < 0",
-             answer.transition_count);
-  xbt_assert(answer.transition_count == 0 || answer.count >= 0,
-             "Received an ACTOR_STATUS_REPLY message with no actor data "
-             "but with transition data nonetheless");
 
   std::vector<s_mc_message_actors_status_one_t> status(answer.count);
   if (answer.count > 0) {
@@ -107,15 +102,6 @@ void RemoteApp::get_actors_status(std::map<aid_t, ActorState>& whereto) const
     xbt_assert(static_cast<size_t>(received) == size);
   }
 
-  // Ensures that each actor sends precisely `answer.transition_count` transitions. While technically
-  // this doesn't catch the edge case where actor A sends 3 instead of 2 and actor B sends 2 instead
-  // of 3 transitions, that is ignored here since that invariant needs to be enforced on the AppSide
-  const auto expected_transitions = std::accumulate(
-      status.begin(), status.end(), 0, [](int total, const auto& actor) { return total + actor.n_transitions; });
-  xbt_assert(expected_transitions == answer.transition_count,
-             "Expected to receive %d transition(s) but was only notified of %d by the app side", expected_transitions,
-             answer.transition_count);
-
   whereto.clear();
 
   for (const auto& actor : status) {
index 7e642f6..3299189 100644 (file)
@@ -163,21 +163,18 @@ void AppSide::handle_actors_status() const
 
   std::vector<s_mc_message_actors_status_one_t> status(num_actors);
   int i                 = 0;
-  int total_transitions = 0;
 
   for (auto const& [aid, actor] : actor_list) {
     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;
-    total_transitions += status[i].n_transitions;
     i++;
   }
 
   struct s_mc_message_actors_status_answer_t answer = {};
   answer.type             = MessageType::ACTORS_STATUS_REPLY;
   answer.count            = num_actors;
-  answer.transition_count = total_transitions;
 
   xbt_assert(channel_.send(answer) == 0, "Could not send ACTORS_STATUS_REPLY msg");
   if (answer.count > 0) {
index 1081284..caa405b 100644 (file)
@@ -104,7 +104,6 @@ struct s_mc_message_restore_t {
 struct s_mc_message_actors_status_answer_t {
   simgrid::mc::MessageType type;
   int count;
-  int transition_count; // The total number of transitions sent as a payload to the checker
 };
 struct s_mc_message_actors_status_one_t { // an array of `s_mc_message_actors_status_one_t[count]` is sent right after
                                           // after a `s_mc_message_actors_status_answer_t`