Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines.
[simgrid.git] / src / mc / mc_record.cpp
index 685c491..b326b20 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -28,20 +28,20 @@ void replay(RecordTrace const& trace)
   simgrid::mc::wait_for_requests();
 
   for (simgrid::mc::Transition const& transition : trace) {
-    XBT_DEBUG("Executing %i$%i", transition.pid, transition.argument);
+    XBT_DEBUG("Executing %i$%i", transition.pid_, transition.argument_);
 
     // Choose a request:
-    smx_actor_t process = SIMIX_process_from_PID(transition.pid);
-    if (not process)
-      xbt_die("Unexpected process (pid:%d).", transition.pid);
-    smx_simcall_t simcall = &(process->simcall);
-    if (not simcall || simcall->call == SIMCALL_NONE)
-      xbt_die("No simcall for process %d.", transition.pid);
-    if (not simgrid::mc::request_is_visible(simcall) || not simgrid::mc::actor_is_enabled(process))
+    kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_PID(transition.pid_);
+    if (actor == nullptr)
+      xbt_die("Unexpected actor (id:%d).", transition.pid_);
+    const s_smx_simcall* simcall = &(actor->simcall_);
+    if (simcall->call_ == simix::Simcall::NONE)
+      xbt_die("No simcall for process %d.", transition.pid_);
+    if (not simgrid::mc::request_is_visible(simcall) || not simgrid::mc::actor_is_enabled(actor))
       xbt_die("Unexpected simcall.");
 
     // Execute the request:
-    SIMIX_simcall_handle(simcall, transition.argument);
+    simcall->issuer_->simcall_handle(transition.argument_);
     simgrid::mc::wait_for_requests();
   }
 }
@@ -63,9 +63,9 @@ RecordTrace parseRecordTrace(const char* data)
 
   const char* current = data;
   while (*current) {
-
     simgrid::mc::Transition item;
-    int count = sscanf(current, "%d/%d", &item.pid, &item.argument);
+    int count = sscanf(current, "%d/%d", &item.pid_, &item.argument_);
+
     if(count != 2 && count != 1)
       throw std::invalid_argument("Could not parse record path");
     res.push_back(item);
@@ -89,9 +89,9 @@ 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;
-    if (i->argument)
-      stream << '/' << i->argument;
+    stream << i->pid_;
+    if (i->argument_)
+      stream << '/' << i->argument_;
   }
   return stream.str();
 }