Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename model_checker->get_remote_simulation() into model_checker->get_remote_process()
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 14 Mar 2021 00:00:05 +0000 (01:00 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 14 Mar 2021 00:00:05 +0000 (01:00 +0100)
src/mc/AddressSpace.hpp
src/mc/ModelChecker.cpp
src/mc/ModelChecker.hpp
src/mc/Session.cpp
src/mc/api.cpp
src/mc/compare.cpp
src/mc/mc_request.cpp
src/mc/sosp/Region.cpp
src/mc/sosp/Snapshot.cpp
src/mc/sosp/Snapshot.hpp

index fd136eb..e9d152c 100644 (file)
@@ -87,14 +87,14 @@ private:
   RemoteProcess* remote_process_;
 
 public:
-  explicit AddressSpace(RemoteProcess* remote_simulation) : remote_process_(remote_simulation) {}
+  explicit AddressSpace(RemoteProcess* process) : remote_process_(process) {}
   virtual ~AddressSpace() = default;
 
   /** The process of this address space
    *
    *  This is where we can get debug information, memory layout, etc.
    */
-  simgrid::mc::RemoteProcess* get_remote_simulation() const { return remote_process_; }
+  simgrid::mc::RemoteProcess* get_remote_process() const { return remote_process_; }
 
   /** Read data from the address space
    *
index 5da95f6..060b4dd 100644 (file)
@@ -95,7 +95,7 @@ static constexpr auto ignored_local_variables = {
 
 void ModelChecker::setup_ignore()
 {
-  const RemoteProcess& process = this->get_remote_simulation();
+  const RemoteProcess& process = this->get_remote_process();
   for (auto const& var : ignored_local_variables)
     process.ignore_local_variable(var.first, var.second);
 
@@ -107,7 +107,7 @@ void ModelChecker::shutdown()
 {
   XBT_DEBUG("Shutting down model-checker");
 
-  RemoteProcess* process = &this->get_remote_simulation();
+  RemoteProcess* process = &this->get_remote_process();
   if (process->running()) {
     XBT_DEBUG("Killing process");
     kill(process->pid(), SIGKILL);
@@ -143,7 +143,7 @@ static void MC_report_crash(int status)
     XBT_INFO("Stack trace not displayed because you passed --log=no_loc");
   } else {
     XBT_INFO("Stack trace:");
-    mc_model_checker->get_remote_simulation().dump_stack();
+    mc_model_checker->get_remote_process().dump_stack();
   }
 }
 
@@ -176,7 +176,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       region.fragment = message.fragment;
       region.address  = message.address;
       region.size     = message.size;
-      get_remote_simulation().ignore_heap(region);
+      get_remote_process().ignore_heap(region);
       break;
     }
 
@@ -184,7 +184,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       s_mc_message_ignore_memory_t message;
       xbt_assert(size == sizeof(message), "Broken message");
       memcpy(&message, buffer, sizeof(message));
-      get_remote_simulation().unignore_heap((void*)(std::uintptr_t)message.addr, message.size);
+      get_remote_process().unignore_heap((void*)(std::uintptr_t)message.addr, message.size);
       break;
     }
 
@@ -192,7 +192,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       s_mc_message_ignore_memory_t message;
       xbt_assert(size == sizeof(message), "Broken message");
       memcpy(&message, buffer, sizeof(message));
-      this->get_remote_simulation().ignore_region(message.addr, message.size);
+      this->get_remote_process().ignore_region(message.addr, message.size);
       break;
     }
 
@@ -200,7 +200,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       s_mc_message_stack_region_t message;
       xbt_assert(size == sizeof(message), "Broken message");
       memcpy(&message, buffer, sizeof(message));
-      this->get_remote_simulation().stack_areas().push_back(message.stack_region);
+      this->get_remote_process().stack_areas().push_back(message.stack_region);
     } break;
 
     case MessageType::REGISTER_SYMBOL: {
@@ -213,7 +213,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       if (property_automaton == nullptr)
         property_automaton = xbt_automaton_new();
 
-      const RemoteProcess* process    = &this->get_remote_simulation();
+      const RemoteProcess* process    = &this->get_remote_process();
       RemotePtr<int> address          = remote((int*)message.data);
       xbt::add_proposition(property_automaton, message.name.data(),
                            [process, address]() { return process->read(address); });
@@ -238,8 +238,8 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
 void ModelChecker::exit(int status)
 {
   // TODO, terminate the model checker politely instead of exiting rudely
-  if (get_remote_simulation().running())
-    kill(get_remote_simulation().pid(), SIGKILL);
+  if (get_remote_process().running())
+    kill(get_remote_process().pid(), SIGKILL);
   ::exit(status);
 }
 
@@ -252,7 +252,7 @@ void ModelChecker::handle_waitpid()
     if (pid == -1) {
       if (errno == ECHILD) {
         // No more children:
-        xbt_assert(not this->get_remote_simulation().running(), "Inconsistent state");
+        xbt_assert(not this->get_remote_process().running(), "Inconsistent state");
         break;
       } else {
         XBT_ERROR("Could not wait for pid");
@@ -260,7 +260,7 @@ void ModelChecker::handle_waitpid()
       }
     }
 
-    if (pid == this->get_remote_simulation().pid()) {
+    if (pid == this->get_remote_process().pid()) {
       // From PTRACE_O_TRACEEXIT:
 #ifdef __linux__
       if (status>>8 == (SIGTRAP | (PTRACE_EVENT_EXIT<<8))) {
@@ -289,7 +289,7 @@ void ModelChecker::handle_waitpid()
         mc_model_checker->exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
       } else if (WIFEXITED(status)) {
         XBT_DEBUG("Child process is over");
-        this->get_remote_simulation().terminate();
+        this->get_remote_process().terminate();
       }
     }
   }
@@ -297,8 +297,8 @@ void ModelChecker::handle_waitpid()
 
 void ModelChecker::wait_for_requests()
 {
-  this->resume(get_remote_simulation());
-  if (this->get_remote_simulation().running())
+  this->resume(get_remote_process());
+  if (this->get_remote_process().running())
     checker_side_.dispatch();
 }
 
index 0bd231a..a01e78c 100644 (file)
@@ -36,7 +36,7 @@ public:
   ModelChecker& operator=(ModelChecker const&) = delete;
   explicit ModelChecker(std::unique_ptr<RemoteProcess> remote_simulation, int sockfd);
 
-  RemoteProcess& get_remote_simulation() { return *remote_process_; }
+  RemoteProcess& get_remote_process() { return *remote_process_; }
   Channel& channel() { return checker_side_.get_channel(); }
   PageStore& page_store() { return page_store_; }
 
index 401346b..0bd6e82 100644 (file)
@@ -114,7 +114,7 @@ void Session::execute(Transition const& transition) const
 
 void Session::restore_initial_state() const
 {
-  this->initial_snapshot_->restore(&model_checker_->get_remote_simulation());
+  this->initial_snapshot_->restore(&model_checker_->get_remote_process());
 }
 
 void Session::log_state() const
index f95a8b2..ecab76b 100644 (file)
@@ -118,7 +118,7 @@ static inline smx_simcall_t MC_state_choose_request_for_process(simgrid::mc::Sta
         simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> remote_act =
             remote(simcall_comm_wait__get__comm(&actor->simcall_));
         simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_act;
-        mc_model_checker->get_remote_simulation().read(temp_act, remote_act);
+        mc_model_checker->get_remote_process().read(temp_act, remote_act);
         const simgrid::kernel::activity::CommImpl* act = temp_act.get_buffer();
         if (act->src_actor_.get() && act->dst_actor_.get())
           state->transition_.times_considered_ = 0; // OK
@@ -162,33 +162,33 @@ static void simcall_translate(smx_simcall_t req,
   switch (req->call_) {
     case Simcall::COMM_WAITANY:
       req->call_  = Simcall::COMM_WAIT;
-      chosen_comm = mc_model_checker->get_remote_simulation().read(
-          remote(simcall_comm_waitany__get__comms(req) + req->mc_value_));
+      chosen_comm =
+          mc_model_checker->get_remote_process().read(remote(simcall_comm_waitany__get__comms(req) + req->mc_value_));
 
-      mc_model_checker->get_remote_simulation().read(buffered_comm, remote(chosen_comm));
+      mc_model_checker->get_remote_process().read(buffered_comm, remote(chosen_comm));
       simcall_comm_wait__set__comm(req, buffered_comm.get_buffer());
       simcall_comm_wait__set__timeout(req, 0);
       break;
 
     case Simcall::COMM_TESTANY:
       req->call_  = Simcall::COMM_TEST;
-      chosen_comm = mc_model_checker->get_remote_simulation().read(
-          remote(simcall_comm_testany__get__comms(req) + req->mc_value_));
+      chosen_comm =
+          mc_model_checker->get_remote_process().read(remote(simcall_comm_testany__get__comms(req) + req->mc_value_));
 
-      mc_model_checker->get_remote_simulation().read(buffered_comm, remote(chosen_comm));
+      mc_model_checker->get_remote_process().read(buffered_comm, remote(chosen_comm));
       simcall_comm_test__set__comm(req, buffered_comm.get_buffer());
       simcall_comm_test__set__result(req, req->mc_value_);
       break;
 
     case Simcall::COMM_WAIT:
       chosen_comm = simcall_comm_wait__get__comm(req);
-      mc_model_checker->get_remote_simulation().read(buffered_comm, remote(chosen_comm));
+      mc_model_checker->get_remote_process().read(buffered_comm, remote(chosen_comm));
       simcall_comm_wait__set__comm(req, buffered_comm.get_buffer());
       break;
 
     case Simcall::COMM_TEST:
       chosen_comm = simcall_comm_test__get__comm(req);
-      mc_model_checker->get_remote_simulation().read(buffered_comm, remote(chosen_comm));
+      mc_model_checker->get_remote_process().read(buffered_comm, remote(chosen_comm));
       simcall_comm_test__set__comm(req, buffered_comm.get_buffer());
       break;
 
@@ -333,7 +333,7 @@ xbt::string const& Api::get_actor_host_name(smx_actor_t actor) const
   if (mc_model_checker == nullptr)
     return actor->get_host()->get_name();
 
-  const simgrid::mc::RemoteProcess* process = &mc_model_checker->get_remote_simulation();
+  const simgrid::mc::RemoteProcess* process = &mc_model_checker->get_remote_process();
 
   // Read the simgrid::xbt::string in the MCed process:
   simgrid::mc::ActorInformation* info = actor_info_cast(actor);
@@ -354,7 +354,7 @@ std::string Api::get_actor_name(smx_actor_t actor) const
 
   simgrid::mc::ActorInformation* info = actor_info_cast(actor);
   if (info->name.empty()) {
-    const simgrid::mc::RemoteProcess* process = &mc_model_checker->get_remote_simulation();
+    const simgrid::mc::RemoteProcess* process = &mc_model_checker->get_remote_process();
 
     simgrid::xbt::string_data string_data = simgrid::xbt::string::to_string_data(actor->name_);
     info->name = process->read_string(remote(string_data.data), string_data.len);
@@ -424,7 +424,7 @@ simgrid::mc::Checker* Api::initialize(char** argv, simgrid::mc::CheckerAlgorithm
 
 std::vector<simgrid::mc::ActorInformation>& Api::get_actors() const
 {
-  return mc_model_checker->get_remote_simulation().actors();
+  return mc_model_checker->get_remote_process().actors();
 }
 
 bool Api::actor_is_enabled(aid_t pid) const
@@ -437,17 +437,17 @@ unsigned long Api::get_maxpid() const
   static const char* name = nullptr;
   if (not name) {
     name = "simgrid::kernel::actor::maxpid";
-    if (mc_model_checker->get_remote_simulation().find_variable(name) == nullptr)
+    if (mc_model_checker->get_remote_process().find_variable(name) == nullptr)
       name = "maxpid"; // We seem to miss the namespaces when compiling with GCC
   }
   unsigned long maxpid;
-  mc_model_checker->get_remote_simulation().read_variable(name, &maxpid, sizeof(maxpid));
+  mc_model_checker->get_remote_process().read_variable(name, &maxpid, sizeof(maxpid));
   return maxpid;
 }
 
 int Api::get_actors_size() const
 {
-  return mc_model_checker->get_remote_simulation().actors().size();
+  return mc_model_checker->get_remote_process().actors().size();
 }
 
 RemotePtr<kernel::activity::CommImpl> Api::get_comm_isend_raw_addr(smx_simcall_t request) const
@@ -458,52 +458,52 @@ RemotePtr<kernel::activity::CommImpl> Api::get_comm_isend_raw_addr(smx_simcall_t
 RemotePtr<kernel::activity::CommImpl> Api::get_comm_waitany_raw_addr(smx_simcall_t request, int value) const
 {
   auto addr      = simcall_comm_waitany__getraw__comms(request) + value;
-  auto comm_addr = mc_model_checker->get_remote_simulation().read(remote(addr));
+  auto comm_addr = mc_model_checker->get_remote_process().read(remote(addr));
   return RemotePtr<kernel::activity::CommImpl>(static_cast<kernel::activity::CommImpl*>(comm_addr));
 }
 
 std::string Api::get_pattern_comm_rdv(RemotePtr<kernel::activity::CommImpl> const& addr) const
 {
   Remote<kernel::activity::CommImpl> temp_activity;
-  mc_model_checker->get_remote_simulation().read(temp_activity, addr);
+  mc_model_checker->get_remote_process().read(temp_activity, addr);
   const kernel::activity::CommImpl* activity = temp_activity.get_buffer();
 
-  char* remote_name = mc_model_checker->get_remote_simulation().read<char*>(RemotePtr<char*>(
+  char* remote_name = mc_model_checker->get_remote_process().read<char*>(RemotePtr<char*>(
       (uint64_t)(activity->get_mailbox() ? &activity->get_mailbox()->get_name() : &activity->mbox_cpy->get_name())));
-  auto rdv          = mc_model_checker->get_remote_simulation().read_string(RemotePtr<char>(remote_name));
+  auto rdv          = mc_model_checker->get_remote_process().read_string(RemotePtr<char>(remote_name));
   return rdv;
 }
 
 unsigned long Api::get_pattern_comm_src_proc(RemotePtr<kernel::activity::CommImpl> const& addr) const
 {
   Remote<kernel::activity::CommImpl> temp_activity;
-  mc_model_checker->get_remote_simulation().read(temp_activity, addr);
+  mc_model_checker->get_remote_process().read(temp_activity, addr);
   const kernel::activity::CommImpl* activity = temp_activity.get_buffer();
   auto src_proc =
-      mc_model_checker->get_remote_simulation().resolve_actor(mc::remote(activity->src_actor_.get()))->get_pid();
+      mc_model_checker->get_remote_process().resolve_actor(mc::remote(activity->src_actor_.get()))->get_pid();
   return src_proc;
 }
 
 unsigned long Api::get_pattern_comm_dst_proc(RemotePtr<kernel::activity::CommImpl> const& addr) const
 {
   Remote<kernel::activity::CommImpl> temp_activity;
-  mc_model_checker->get_remote_simulation().read(temp_activity, addr);
+  mc_model_checker->get_remote_process().read(temp_activity, addr);
   const kernel::activity::CommImpl* activity = temp_activity.get_buffer();
   auto src_proc =
-      mc_model_checker->get_remote_simulation().resolve_actor(mc::remote(activity->dst_actor_.get()))->get_pid();
+      mc_model_checker->get_remote_process().resolve_actor(mc::remote(activity->dst_actor_.get()))->get_pid();
   return src_proc;
 }
 
 std::vector<char> Api::get_pattern_comm_data(RemotePtr<kernel::activity::CommImpl> const& addr) const
 {
   simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
-  mc_model_checker->get_remote_simulation().read(temp_comm, addr);
+  mc_model_checker->get_remote_process().read(temp_comm, addr);
   const simgrid::kernel::activity::CommImpl* comm = temp_comm.get_buffer();
 
   std::vector<char> buffer{};
   if (comm->src_buff_ != nullptr) {
     buffer.resize(comm->src_buff_size_);
-    mc_model_checker->get_remote_simulation().read_bytes(buffer.data(), buffer.size(), remote(comm->src_buff_));
+    mc_model_checker->get_remote_process().read_bytes(buffer.data(), buffer.size(), remote(comm->src_buff_));
   }
   return buffer;
 }
@@ -512,7 +512,7 @@ std::vector<char> Api::get_pattern_comm_data(RemotePtr<kernel::activity::CommImp
 bool Api::check_send_request_detached(smx_simcall_t const& simcall) const
 {
   simgrid::smpi::Request mpi_request;
-  mc_model_checker->get_remote_simulation().read(
+  mc_model_checker->get_remote_process().read(
       &mpi_request, remote(static_cast<smpi::Request*>(simcall_comm_isend__get__data(simcall))));
   return mpi_request.detached();
 }
@@ -521,26 +521,26 @@ bool Api::check_send_request_detached(smx_simcall_t const& simcall) const
 smx_actor_t Api::get_src_actor(RemotePtr<kernel::activity::CommImpl> const& comm_addr) const
 {
   simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
-  mc_model_checker->get_remote_simulation().read(temp_comm, comm_addr);
+  mc_model_checker->get_remote_process().read(temp_comm, comm_addr);
   const simgrid::kernel::activity::CommImpl* comm = temp_comm.get_buffer();
 
-  auto src_proc = mc_model_checker->get_remote_simulation().resolve_actor(simgrid::mc::remote(comm->src_actor_.get()));
+  auto src_proc = mc_model_checker->get_remote_process().resolve_actor(simgrid::mc::remote(comm->src_actor_.get()));
   return src_proc;
 }
 
 smx_actor_t Api::get_dst_actor(RemotePtr<kernel::activity::CommImpl> const& comm_addr) const
 {
   simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
-  mc_model_checker->get_remote_simulation().read(temp_comm, comm_addr);
+  mc_model_checker->get_remote_process().read(temp_comm, comm_addr);
   const simgrid::kernel::activity::CommImpl* comm = temp_comm.get_buffer();
 
-  auto dst_proc = mc_model_checker->get_remote_simulation().resolve_actor(simgrid::mc::remote(comm->dst_actor_.get()));
+  auto dst_proc = mc_model_checker->get_remote_process().resolve_actor(simgrid::mc::remote(comm->dst_actor_.get()));
   return dst_proc;
 }
 
 std::size_t Api::get_remote_heap_bytes() const
 {
-  RemoteProcess& process    = mc_model_checker->get_remote_simulation();
+  RemoteProcess& process    = mc_model_checker->get_remote_process();
   auto heap_bytes_used      = mmalloc_get_bytes_used_remote(process.get_heap()->heaplimit, process.get_malloc_info());
   return heap_bytes_used;
 }
@@ -595,10 +595,10 @@ smx_actor_t Api::simcall_get_issuer(s_smx_simcall const* req) const
   auto address = simgrid::mc::remote(req->issuer_);
 
   // Lookup by address:
-  for (auto& actor : mc_model_checker->get_remote_simulation().actors())
+  for (auto& actor : mc_model_checker->get_remote_process().actors())
     if (actor.address == address)
       return actor.copy.get_buffer();
-  for (auto& actor : mc_model_checker->get_remote_simulation().dead_actors())
+  for (auto& actor : mc_model_checker->get_remote_process().dead_actors())
     if (actor.address == address)
       return actor.copy.get_buffer();
 
@@ -661,7 +661,7 @@ void Api::dump_record_path() const
 
 smx_simcall_t Api::mc_state_choose_request(simgrid::mc::State* state) const
 {
-  for (auto& actor : mc_model_checker->get_remote_simulation().actors()) {
+  for (auto& actor : mc_model_checker->get_remote_process().actors()) {
     /* Only consider the actors that were marked as interleaving by the checker algorithm */
     if (not state->actor_states_[actor.copy.get_buffer()->get_pid()].is_todo())
       continue;
@@ -677,7 +677,7 @@ std::list<transition_detail_t> Api::get_enabled_transitions(simgrid::mc::State*
 {
   std::list<transition_detail_t> tr_list{};
 
-  for (auto& actor : mc_model_checker->get_remote_simulation().actors()) {
+  for (auto& actor : mc_model_checker->get_remote_process().actors()) {
     auto actor_pid  = actor.copy.get_buffer()->get_pid();
     auto actor_impl = actor.copy.get_buffer();
 
@@ -704,7 +704,7 @@ std::list<transition_detail_t> Api::get_enabled_transitions(simgrid::mc::State*
     }
     tr_list.emplace_back(std::move(transition));
   }
-  
+
   return tr_list;
 }
 
@@ -732,7 +732,7 @@ std::string Api::request_to_string(smx_simcall_t req, int value) const
       size_t* remote_size = simcall_comm_irecv__get__dst_buff_size(req);
       size_t size         = 0;
       if (remote_size)
-        mc_model_checker->get_remote_simulation().read_bytes(&size, sizeof(size), remote(remote_size));
+        mc_model_checker->get_remote_process().read_bytes(&size, sizeof(size), remote(remote_size));
 
       type = "iRecv";
       args = "dst=" + get_actor_string(issuer);
@@ -751,13 +751,13 @@ std::string Api::request_to_string(smx_simcall_t req, int value) const
 
         simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_activity;
         const simgrid::kernel::activity::CommImpl* act;
-        mc_model_checker->get_remote_simulation().read(temp_activity, remote(remote_act));
+        mc_model_checker->get_remote_process().read(temp_activity, remote(remote_act));
         act = temp_activity.get_buffer();
 
         smx_actor_t src_proc =
-            mc_model_checker->get_remote_simulation().resolve_actor(simgrid::mc::remote(act->src_actor_.get()));
+            mc_model_checker->get_remote_process().resolve_actor(simgrid::mc::remote(act->src_actor_.get()));
         smx_actor_t dst_proc =
-            mc_model_checker->get_remote_simulation().resolve_actor(simgrid::mc::remote(act->dst_actor_.get()));
+            mc_model_checker->get_remote_process().resolve_actor(simgrid::mc::remote(act->dst_actor_.get()));
         args = "comm=" + pointer_to_string(remote_act);
         args += " [" + get_actor_string(src_proc) + "-> " + get_actor_string(dst_proc) + "]";
       }
@@ -768,7 +768,7 @@ std::string Api::request_to_string(smx_simcall_t req, int value) const
       simgrid::kernel::activity::CommImpl* remote_act = simcall_comm_test__get__comm(req);
       simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_activity;
       const simgrid::kernel::activity::CommImpl* act;
-      mc_model_checker->get_remote_simulation().read(temp_activity, remote(remote_act));
+      mc_model_checker->get_remote_process().read(temp_activity, remote(remote_act));
       act = temp_activity.get_buffer();
 
       if (act->src_actor_.get() == nullptr || act->dst_actor_.get() == nullptr) {
@@ -778,9 +778,9 @@ std::string Api::request_to_string(smx_simcall_t req, int value) const
         type = "Test TRUE";
 
         smx_actor_t src_proc =
-            mc_model_checker->get_remote_simulation().resolve_actor(simgrid::mc::remote(act->src_actor_.get()));
+            mc_model_checker->get_remote_process().resolve_actor(simgrid::mc::remote(act->src_actor_.get()));
         smx_actor_t dst_proc =
-            mc_model_checker->get_remote_simulation().resolve_actor(simgrid::mc::remote(act->dst_actor_.get()));
+            mc_model_checker->get_remote_process().resolve_actor(simgrid::mc::remote(act->dst_actor_.get()));
         args = "comm=" + pointer_to_string(remote_act);
         args += " [" + get_actor_string(src_proc) + " -> " + get_actor_string(dst_proc) + "]";
       }
@@ -793,7 +793,7 @@ std::string Api::request_to_string(smx_simcall_t req, int value) const
       if (count > 0) {
         simgrid::kernel::activity::CommImpl* remote_sync;
         remote_sync =
-            mc_model_checker->get_remote_simulation().read(remote(simcall_comm_waitany__get__comms(req) + value));
+            mc_model_checker->get_remote_process().read(remote(simcall_comm_waitany__get__comms(req) + value));
         args = "comm=" + pointer_to_string(remote_sync) + xbt::string_printf("(%d of %zu)", value + 1, count);
       } else
         args = "comm at idx " + std::to_string(value);
@@ -844,14 +844,14 @@ std::string Api::request_get_dot_output(smx_simcall_t req, int value) const
         } else {
           kernel::activity::ActivityImpl* remote_act = simcall_comm_wait__get__comm(req);
           Remote<kernel::activity::CommImpl> temp_comm;
-          mc_model_checker->get_remote_simulation().read(temp_comm,
-                                                         remote(static_cast<kernel::activity::CommImpl*>(remote_act)));
+          mc_model_checker->get_remote_process().read(temp_comm,
+                                                      remote(static_cast<kernel::activity::CommImpl*>(remote_act)));
           const kernel::activity::CommImpl* comm = temp_comm.get_buffer();
 
           const kernel::actor::ActorImpl* src_proc =
-              mc_model_checker->get_remote_simulation().resolve_actor(mc::remote(comm->src_actor_.get()));
+              mc_model_checker->get_remote_process().resolve_actor(mc::remote(comm->src_actor_.get()));
           const kernel::actor::ActorImpl* dst_proc =
-              mc_model_checker->get_remote_simulation().resolve_actor(mc::remote(comm->dst_actor_.get()));
+              mc_model_checker->get_remote_process().resolve_actor(mc::remote(comm->dst_actor_.get()));
           label = "[" + get_actor_dot_label(issuer) + "] Wait";
           label += " [(" + std::to_string(src_proc ? src_proc->get_pid() : 0) + ")";
           label += "->(" + std::to_string(dst_proc ? dst_proc->get_pid() : 0) + ")]";
@@ -861,8 +861,8 @@ std::string Api::request_get_dot_output(smx_simcall_t req, int value) const
       case Simcall::COMM_TEST: {
         kernel::activity::ActivityImpl* remote_act = simcall_comm_test__get__comm(req);
         Remote<simgrid::kernel::activity::CommImpl> temp_comm;
-        mc_model_checker->get_remote_simulation().read(temp_comm,
-                                                       remote(static_cast<kernel::activity::CommImpl*>(remote_act)));
+        mc_model_checker->get_remote_process().read(temp_comm,
+                                                    remote(static_cast<kernel::activity::CommImpl*>(remote_act)));
         const kernel::activity::CommImpl* comm = temp_comm.get_buffer();
         if (comm->src_actor_.get() == nullptr || comm->dst_actor_.get() == nullptr) {
           label = "[" + get_actor_dot_label(issuer) + "] Test FALSE";
@@ -902,14 +902,14 @@ int Api::get_smpi_request_tag(smx_simcall_t const& simcall, simgrid::simix::Simc
     simcall_data = simcall_comm_isend__get__data(simcall);
   else if (type == Simcall::COMM_IRECV)
     simcall_data = simcall_comm_irecv__get__data(simcall);
-  mc_model_checker->get_remote_simulation().read(&mpi_request, remote(static_cast<smpi::Request*>(simcall_data)));
+  mc_model_checker->get_remote_process().read(&mpi_request, remote(static_cast<smpi::Request*>(simcall_data)));
   return mpi_request.tag();
 }
 #endif
 
 void Api::restore_state(std::shared_ptr<simgrid::mc::Snapshot> system_state) const
 {
-  system_state->restore(&mc_model_checker->get_remote_simulation());
+  system_state->restore(&mc_model_checker->get_remote_process());
 }
 
 void Api::log_state() const
index 15cecb7..2d9b086 100644 (file)
@@ -142,7 +142,7 @@ static ssize_t heap_comparison_ignore_size(const std::vector<simgrid::mc::Ignore
 
 static bool is_stack(const void *address)
 {
-  auto const& stack_areas = mc_model_checker->get_remote_simulation().stack_areas();
+  auto const& stack_areas = mc_model_checker->get_remote_process().stack_areas();
   return std::any_of(stack_areas.begin(), stack_areas.end(),
                      [address](auto const& stack) { return stack.address == address; });
 }
@@ -150,7 +150,7 @@ static bool is_stack(const void *address)
 // TODO, this should depend on the snapshot?
 static bool is_block_stack(int block)
 {
-  auto const& stack_areas = mc_model_checker->get_remote_simulation().stack_areas();
+  auto const& stack_areas = mc_model_checker->get_remote_process().stack_areas();
   return std::any_of(stack_areas.begin(), stack_areas.end(),
                      [block](auto const& stack) { return stack.block == block; });
 }
@@ -187,7 +187,7 @@ int StateComparator::initHeapInformation(const s_xbt_mheap_t* heap1, const s_xbt
   if ((heap1->heaplimit != heap2->heaplimit) || (heap1->heapsize != heap2->heapsize))
     return -1;
   this->heaplimit     = heap1->heaplimit;
-  this->std_heap_copy = *mc_model_checker->get_remote_simulation().get_heap();
+  this->std_heap_copy = *mc_model_checker->get_remote_process().get_heap();
   this->processStates[0].initHeapInformation(heap1, i1);
   this->processStates[1].initHeapInformation(heap2, i2);
   return 0;
@@ -207,7 +207,7 @@ static bool heap_area_differ(StateComparator& state, const void* area1, const vo
 
 static bool mmalloc_heap_differ(StateComparator& state, const Snapshot& snapshot1, const Snapshot& snapshot2)
 {
-  const RemoteProcess& process = mc_model_checker->get_remote_simulation();
+  const RemoteProcess& process = mc_model_checker->get_remote_process();
 
   /* Check busy blocks */
   size_t i1 = 1;
@@ -435,7 +435,7 @@ static bool heap_area_differ_without_type(StateComparator& state, const void* re
                                           const Snapshot& snapshot1, const Snapshot& snapshot2,
                                           HeapLocationPairs* previous, int size, int check_ignore)
 {
-  const RemoteProcess& process = mc_model_checker->get_remote_simulation();
+  const RemoteProcess& process = mc_model_checker->get_remote_process();
   const Region* heap_region1  = MC_get_heap_region(snapshot1);
   const Region* heap_region2  = MC_get_heap_region(snapshot2);
 
@@ -721,7 +721,7 @@ static Type* get_offset_type(void* real_base_address, Type* type, int offset, in
 static bool heap_area_differ(StateComparator& state, const void* area1, const void* area2, const Snapshot& snapshot1,
                              const Snapshot& snapshot2, HeapLocationPairs* previous, Type* type, int pointer_level)
 {
-  const simgrid::mc::RemoteProcess& process = mc_model_checker->get_remote_simulation();
+  const simgrid::mc::RemoteProcess& process = mc_model_checker->get_remote_process();
 
   ssize_t block1;
   ssize_t block2;
@@ -1188,7 +1188,7 @@ bool snapshot_equal(const Snapshot* s1, const Snapshot* s2)
   // TODO, make this a field of ModelChecker or something similar
   static StateComparator state_comparator;
 
-  const RemoteProcess& process = mc_model_checker->get_remote_simulation();
+  const RemoteProcess& process = mc_model_checker->get_remote_process();
 
   if (s1->hash_ != s2->hash_) {
     XBT_VERB("(%d - %d) Different hash: 0x%" PRIx64 "--0x%" PRIx64, s1->num_state_, s2->num_state_, s1->hash_,
index 479bcb6..b1cea8f 100644 (file)
@@ -31,11 +31,11 @@ bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx)
       break;
 
     case Simcall::COMM_WAITANY:
-      remote_act = mc_model_checker->get_remote_simulation().read(remote(simcall_comm_waitany__get__comms(req) + idx));
+      remote_act = mc_model_checker->get_remote_process().read(remote(simcall_comm_waitany__get__comms(req) + idx));
       break;
 
     case Simcall::COMM_TESTANY:
-      remote_act = mc_model_checker->get_remote_simulation().read(remote(simcall_comm_testany__get__comms(req) + idx));
+      remote_act = mc_model_checker->get_remote_process().read(remote(simcall_comm_testany__get__comms(req) + idx));
       break;
 
     default:
@@ -43,7 +43,7 @@ bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx)
   }
 
   Remote<kernel::activity::CommImpl> temp_comm;
-  mc_model_checker->get_remote_simulation().read(temp_comm, remote(remote_act));
+  mc_model_checker->get_remote_process().read(temp_comm, remote(remote_act));
   const kernel::activity::CommImpl* comm = temp_comm.get_buffer();
   return comm->src_actor_.get() && comm->dst_actor_.get();
 }
index 1a43ee4..6219b84 100644 (file)
@@ -23,7 +23,7 @@ Region::Region(RegionType region_type, void* start_addr, size_t size)
 {
   xbt_assert((((uintptr_t)start_addr) & (xbt_pagesize - 1)) == 0, "Start address not at the beginning of a page");
 
-  chunks_ = ChunkedData(mc_model_checker->page_store(), mc_model_checker->get_remote_simulation(),
+  chunks_ = ChunkedData(mc_model_checker->page_store(), mc_model_checker->get_remote_process(),
                         RemotePtr<void>(start_addr), mmu::chunk_count(size));
 }
 
@@ -39,7 +39,7 @@ void Region::restore() const
   for (size_t i = 0; i != get_chunks().page_count(); ++i) {
     void* target_page       = (void*)simgrid::mc::mmu::join(i, (std::uintptr_t)(void*)start().address());
     const void* source_page = get_chunks().page(i);
-    mc_model_checker->get_remote_simulation().write_bytes(source_page, xbt_pagesize, remote(target_page));
+    mc_model_checker->get_remote_process().write_bytes(source_page, xbt_pagesize, remote(target_page));
   }
 }
 
index ec69ce5..82702f9 100644 (file)
@@ -70,7 +70,7 @@ static void fill_local_variables_values(mc_stack_frame_t stack_frame, Frame* sco
     else if (not current_variable.location_list.empty()) {
       dwarf::Location location = simgrid::dwarf::resolve(current_variable.location_list, current_variable.object_info,
                                                          &(stack_frame->unw_cursor), (void*)stack_frame->frame_base,
-                                                         &mc_model_checker->get_remote_simulation());
+                                                         &mc_model_checker->get_remote_process());
 
       if (not location.in_memory())
         xbt_die("Cannot handle non-address variable");
@@ -96,7 +96,7 @@ static std::vector<s_local_variable_t> get_local_variables_values(std::vector<s_
 
 static std::vector<s_mc_stack_frame_t> unwind_stack_frames(UnwindContext* stack_context)
 {
-  const RemoteProcess* process = &mc_model_checker->get_remote_simulation();
+  const RemoteProcess* process = &mc_model_checker->get_remote_process();
   std::vector<s_mc_stack_frame_t> result;
 
   unw_cursor_t c = stack_context->cursor();
@@ -173,28 +173,28 @@ void Snapshot::snapshot_stacks(RemoteProcess* process)
 
 static void snapshot_handle_ignore(Snapshot* snapshot)
 {
-  xbt_assert(snapshot->get_remote_simulation());
+  xbt_assert(snapshot->get_remote_process());
 
   // Copy the memory:
-  for (auto const& region : snapshot->get_remote_simulation()->ignored_regions()) {
+  for (auto const& region : snapshot->get_remote_process()->ignored_regions()) {
     s_mc_snapshot_ignored_data_t ignored_data;
     ignored_data.start = (void*)region.addr;
     ignored_data.data.resize(region.size);
     // TODO, we should do this once per privatization segment:
-    snapshot->get_remote_simulation()->read_bytes(ignored_data.data.data(), region.size, remote(region.addr));
+    snapshot->get_remote_process()->read_bytes(ignored_data.data.data(), region.size, remote(region.addr));
     snapshot->ignored_data_.push_back(std::move(ignored_data));
   }
 
   // Zero the memory:
-  for (auto const& region : snapshot->get_remote_simulation()->ignored_regions())
-    snapshot->get_remote_simulation()->clear_bytes(remote(region.addr), region.size);
+  for (auto const& region : snapshot->get_remote_process()->ignored_regions())
+    snapshot->get_remote_process()->clear_bytes(remote(region.addr), region.size);
 }
 
 static void snapshot_ignore_restore(const simgrid::mc::Snapshot* snapshot)
 {
   for (auto const& ignored_data : snapshot->ignored_data_)
-    snapshot->get_remote_simulation()->write_bytes(ignored_data.data.data(), ignored_data.data.size(),
-                                                   remote(ignored_data.start));
+    snapshot->get_remote_process()->write_bytes(ignored_data.data.data(), ignored_data.data.size(),
+                                                remote(ignored_data.start));
 }
 
 Snapshot::Snapshot(int num_state, RemoteProcess* process) : AddressSpace(process), num_state_(num_state)
@@ -243,7 +243,7 @@ void* Snapshot::read_bytes(void* buffer, std::size_t size, RemotePtr<void> addre
       return buffer;
     }
   } else
-    return this->get_remote_simulation()->read_bytes(buffer, size, address, options);
+    return this->get_remote_process()->read_bytes(buffer, size, address, options);
 }
 /** @brief Find the snapshotted region from a pointer
  *
index 2dfc05b..a39b0d0 100644 (file)
@@ -60,12 +60,12 @@ namespace mc {
 class XBT_PRIVATE Snapshot final : public AddressSpace {
 public:
   /* Initialization */
-  Snapshot(int num_state, RemoteProcess* get_remote_simulation = &mc_model_checker->get_remote_simulation());
+  Snapshot(int num_state, RemoteProcess* get_remote_simulation = &mc_model_checker->get_remote_process());
 
   /* Regular use */
   bool on_heap(const void* address) const
   {
-    const s_xbt_mheap_t* heap = get_remote_simulation()->get_heap();
+    const s_xbt_mheap_t* heap = get_remote_process()->get_heap();
     return address >= heap->heapbase && address < heap->breakval;
   }