Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
objectification of MC simcall achieved -- many tests still failing
[simgrid.git] / src / mc / mc_record.cpp
index bfd5482..38321e4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2020. 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.times_considered_);
 
     // Choose a request:
-    smx_actor_t process = SIMIX_process_from_PID(transition.pid_);
-    if (not process)
-      xbt_die("Unexpected process (pid:%d).", transition.pid_);
-    const s_smx_simcall* simcall = &(process->simcall_);
-    if (simcall == nullptr || simcall->call_ == SIMCALL_NONE)
+    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(process))
+    if (not simgrid::mc::request_is_visible(simcall) || not simgrid::mc::actor_is_enabled(actor))
       xbt_die("Unexpected simcall.");
 
     // Execute the request:
-    simcall->issuer_->simcall_handle(transition.argument_);
+    simcall->issuer_->simcall_handle(transition.times_considered_);
     simgrid::mc::wait_for_requests();
   }
 }
@@ -64,7 +64,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.argument_);
+    int count = sscanf(current, "%d/%d", &item.pid_, &item.times_considered_);
 
     if(count != 2 && count != 1)
       throw std::invalid_argument("Could not parse record path");
@@ -90,8 +90,8 @@ std::string traceToString(simgrid::mc::RecordTrace const& trace)
     if (i != trace.begin())
       stream << ';';
     stream << i->pid_;
-    if (i->argument_)
-      stream << '/' << i->argument_;
+    if (i->times_considered_)
+      stream << '/' << i->times_considered_;
   }
   return stream.str();
 }