Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Actor's ID should be a long, and should be named AID
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Wed, 31 Mar 2021 21:08:43 +0000 (23:08 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 1 Apr 2021 07:22:25 +0000 (09:22 +0200)
src/mc/ModelChecker.cpp
src/mc/Transition.hpp
src/mc/api.cpp
src/mc/mc_record.cpp
src/mc/remote/AppSide.cpp
src/mc/remote/mc_protocol.h

index 8f0728f..a4feac6 100644 (file)
@@ -312,7 +312,7 @@ void ModelChecker::handle_simcall(Transition const& transition)
   s_mc_message_simcall_handle_t m;
   memset(&m, 0, sizeof(m));
   m.type  = MessageType::SIMCALL_HANDLE;
-  m.pid_              = transition.pid_;
+  m.aid_              = transition.aid_;
   m.times_considered_ = transition.times_considered_;
   checker_side_.get_channel().send(m);
   this->remote_process_->clear_cache();
index 1e9a58a..a8a151e 100644 (file)
@@ -22,7 +22,7 @@ namespace mc {
  */
 class Transition {
 public:
-  int pid_ = 0;
+  long aid_ = 0;
 
   /* Which transition was executed for this simcall
    *
index 5057050..6f54255 100644 (file)
@@ -92,7 +92,7 @@ static inline smx_simcall_t MC_state_choose_request_for_process(const RemoteProc
 {
   /* reset the outgoing transition */
   simgrid::mc::ActorState* procstate = &state->actor_states_[actor->get_pid()];
-  state->transition_.pid_            = -1;
+  state->transition_.aid_              = -1;
   state->transition_.times_considered_ = -1;
   state->transition_.textual[0]        = '\0';
   state->executed_req_.call_         = Simcall::NONE;
@@ -170,7 +170,7 @@ static inline smx_simcall_t MC_state_choose_request_for_process(const RemoteProc
   if (not req)
     return nullptr;
 
-  state->transition_.pid_ = actor->get_pid();
+  state->transition_.aid_ = actor->get_pid();
   state->executed_req_    = *req;
 
   // Fetch the data of the request and translate it:
index e09251e..d8be674 100644 (file)
@@ -26,15 +26,15 @@ void replay(RecordTrace const& trace)
   simgrid::mc::execute_actors();
 
   for (simgrid::mc::Transition const& transition : trace) {
-    XBT_DEBUG("Executing %i$%i", transition.pid_, transition.times_considered_);
+    XBT_DEBUG("Executing %ld$%i", transition.aid_, transition.times_considered_);
 
     // Choose a request:
-    kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(transition.pid_);
+    kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(transition.aid_);
     if (actor == nullptr)
-      xbt_die("Unexpected actor (id:%d).", transition.pid_);
+      xbt_die("Unexpected actor (id:%ld).", transition.aid_);
     const s_smx_simcall* simcall = &(actor->simcall_);
     if (simcall->call_ == simix::Simcall::NONE)
-      xbt_die("No simcall for process %d.", transition.pid_);
+      xbt_die("No simcall for process %ld.", transition.aid_);
     if (not simgrid::mc::request_is_visible(simcall) || not simgrid::mc::actor_is_enabled(actor))
       xbt_die("Unexpected simcall.");
 
@@ -62,7 +62,7 @@ RecordTrace parseRecordTrace(const char* data)
   const char* current = data;
   while (*current) {
     simgrid::mc::Transition item;
-    int count = sscanf(current, "%d/%d", &item.pid_, &item.times_considered_);
+    int count = sscanf(current, "%ld/%d", &item.aid_, &item.times_considered_);
 
     if(count != 2 && count != 1)
       throw std::invalid_argument("Could not parse record path");
@@ -87,7 +87,7 @@ std::string traceToString(simgrid::mc::RecordTrace const& trace)
   for (auto i = trace.begin(); i != trace.end(); ++i) {
     if (i != trace.begin())
       stream << ';';
-    stream << i->pid_;
+    stream << i->aid_;
     if (i->times_considered_)
       stream << '/' << i->times_considered_;
   }
index ebb9617..f202218 100644 (file)
@@ -94,8 +94,8 @@ void AppSide::handle_deadlock_check(const s_mc_message_t*) const
 }
 void AppSide::handle_simcall_execute(const s_mc_message_simcall_handle_t* message) const
 {
-  kernel::actor::ActorImpl* process = kernel::actor::ActorImpl::by_pid(message->pid_);
-  xbt_assert(process != nullptr, "Invalid pid %lu", message->pid_);
+  kernel::actor::ActorImpl* process = kernel::actor::ActorImpl::by_pid(message->aid_);
+  xbt_assert(process != nullptr, "Invalid pid %lu", message->aid_);
   process->simcall_handle(message->times_considered_);
   if (channel_.send(MessageType::WAITING))
     xbt_die("Could not send MESSAGE_WAITING to model-checker");
index 58332cd..33d7cb1 100644 (file)
@@ -94,7 +94,7 @@ struct s_mc_message_register_symbol_t {
 /* Server -> client */
 struct s_mc_message_simcall_handle_t {
   simgrid::mc::MessageType type;
-  unsigned long pid_;
+  unsigned long aid_;
   int times_considered_;
 };