Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Hack to make liveness work on Debian testing
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 27 Oct 2023 15:11:39 +0000 (17:11 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 27 Oct 2023 15:22:50 +0000 (17:22 +0200)
A proper solution would be to make the liveness more robust, and in
particular the state equality mechanism. To that extend, we should
 - change the code so that it computes a distance between states
   instead of returning a simple boolean "it's different". That way,
   we could know which states desserve a deeper debugging to
   understand why equality detection is broken, simply by picking the
   closest pair of states, that ought to be equal.

 - Write a bunch of unit tests where we do 2 controled states and
   compare their detected difference.

Maybe, we should trash all this code that is aging (no Dwarf5 support)
and is very complex anyway. A simpler way to get the same effects
could be to go through the compiler, and have clang generate a binary
that is fully introspectable. It sounds like a long and burdensome way
to go, however.

Hopefuly someone will do a library doing it in the future, so that we
just need to use their work.

src/kernel/activity/MailboxImpl.hpp

index d37e756..9d30a4e 100644 (file)
@@ -6,6 +6,7 @@
 #ifndef SIMGRID_KERNEL_ACTIVITY_MAILBOX_HPP
 #define SIMGRID_KERNEL_ACTIVITY_MAILBOX_HPP
 
+#include "simgrid/config.h" /* FIXME: KILLME. This makes the ABI config-dependent, but mandatory for the hack below */
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
@@ -19,9 +20,18 @@ class MailboxImpl {
   s4u::Mailbox piface_;
   std::string name_;
   actor::ActorImplPtr permanent_receiver_; // actor to which the mailbox is attached
+#if SIMGRID_HAVE_STATEFUL_MC
+  /* Using deque here is faster in benchmarks, but break the state equality heuristic of Liveness checking on Debian
+   * testing. This would desserve a proper investiguation, but simply use a single-sided list for the time being. HACK.
+   */
+  std::list<CommImplPtr> comm_queue_;
+  // messages already received in the permanent receive mode
+  std::list<CommImplPtr> done_comm_queue_;
+#else
   std::deque<CommImplPtr> comm_queue_;
   // messages already received in the permanent receive mode
   std::deque<CommImplPtr> done_comm_queue_;
+#endif
 
   friend s4u::Engine;
   friend s4u::Mailbox;