Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Align the behavior of MC and MC_replay in SMPI, so that replay actually works
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 31 Oct 2022 23:25:43 +0000 (00:25 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 31 Oct 2022 23:25:48 +0000 (00:25 +0100)
+ improved debug messages

src/kernel/actor/Simcall.cpp
src/mc/explo/DFSExplorer.cpp
src/mc/mc_base.cpp
src/mc/mc_record.cpp
src/smpi/internals/smpi_global.cpp

index 156636d..9f35a3b 100644 (file)
@@ -20,7 +20,8 @@ namespace simgrid::kernel::actor {
  */
 void ActorImpl::simcall_handle(int times_considered)
 {
-  XBT_DEBUG("Handling simcall %p: %s", &simcall_, simcall_.get_cname());
+  XBT_DEBUG("Handling simcall %p: %s(%ld) %s", &simcall_, simcall_.issuer_->get_cname(), simcall_.issuer_->get_pid(),
+            (simcall_.observer_ != nullptr ? simcall_.observer_->to_string().c_str() : simcall_.get_cname()));
   if (simcall_.observer_ != nullptr)
     simcall_.observer_->prepare(times_considered);
   if (wannadie())
index 03122f3..e0628c0 100644 (file)
@@ -95,7 +95,7 @@ void DFSExplorer::run()
     State* state = stack_.back().get();
 
     XBT_DEBUG("**************************************************");
-    XBT_DEBUG("Exploration depth=%zu (state:%ld; %zu interleaves)", stack_.size(), state->get_num(),
+    XBT_DEBUG("Exploration depth=%zu (state:#%ld; %zu interleaves todo)", stack_.size(), state->get_num(),
               state->count_todo());
 
     mc_model_checker->inc_visited_states();
index e9d6db6..95965ec 100644 (file)
@@ -26,6 +26,8 @@ void execute_actors()
 {
   auto* engine = kernel::EngineImpl::get_instance();
 
+  XBT_DEBUG("execute_actors: %lu of %zu to run (%s)", engine->get_actor_to_run_count(), engine->get_actor_count(),
+            (MC_record_replay_is_active() ? "replay active" : "no replay"));
   while (engine->has_actors_to_run()) {
     engine->run_all_actors();
     for (auto const& actor : engine->get_actors_that_ran()) {
@@ -47,7 +49,6 @@ void execute_actors()
  * transition for ever.
  * This is controlled in the is_enabled() method of the corresponding observers.
  */
-// Called from both MCer and MCed:
 bool actor_is_enabled(kernel::actor::ActorImpl* actor)
 {
 #if SIMGRID_HAVE_MC
index 03d088a..6b9cd75 100644 (file)
@@ -25,14 +25,14 @@ void RecordTrace::replay() const
   simgrid::mc::execute_actors();
 
   for (const simgrid::mc::Transition* transition : transitions_) {
-    XBT_DEBUG("Executing %ld$%i", transition->aid_, transition->times_considered_);
-
-    // Choose a request:
     kernel::actor::ActorImpl* actor = kernel::EngineImpl::get_instance()->get_actor_by_pid(transition->aid_);
     xbt_assert(actor != nullptr, "Unexpected actor (id:%ld).", transition->aid_);
     const kernel::actor::Simcall* simcall = &(actor->simcall_);
     xbt_assert(simgrid::mc::request_is_visible(simcall), "Simcall %s of actor %s is not visible.", simcall->get_cname(),
                actor->get_cname());
+
+    XBT_DEBUG("Executing %ld$%i: %s", transition->aid_, transition->times_considered_,
+              simcall->observer_->to_string().c_str());
     if (not mc::actor_is_enabled(actor))
       simgrid::kernel::EngineImpl::get_instance()->display_all_actor_status();
 
index 8b3a184..3994112 100644 (file)
@@ -13,6 +13,7 @@
 #include "smpi_host.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
+#include "src/mc/mc_replay.hpp"
 #include "src/smpi/include/smpi_actor.hpp"
 #include "xbt/config.hpp"
 #include "xbt/file.hpp"
@@ -630,7 +631,7 @@ void smpi_mpi_init() {
   smpi_init_fortran_types();
   if(_smpi_init_sleep > 0)
     simgrid::s4u::this_actor::sleep_for(_smpi_init_sleep);
-  if (not MC_is_active()) {
+  if (not MC_is_active() && not MC_record_replay_is_active()) {
     smpi_deployment_startup_barrier(smpi_process()->get_instance_id());
   }
 }