Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of github.com:simgrid/simgrid into dev_11
[simgrid.git] / src / mc / mc_state.cpp
index de4158b..c251505 100644 (file)
@@ -4,14 +4,13 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/mc/mc_state.hpp"
-#include "src/mc/mc_comm_pattern.hpp"
 #include "src/mc/mc_config.hpp"
-#include "src/mc/mc_request.hpp"
-#include "src/mc/mc_smx.hpp"
+#include "src/mc/mc_api.hpp"
 
 #include <boost/range/algorithm.hpp>
 
 using simgrid::mc::remote;
+using mcapi = simgrid::mc::mc_api;
 
 namespace simgrid {
 namespace mc {
@@ -19,14 +18,15 @@ namespace mc {
 State::State(unsigned long state_number) : num_(state_number)
 {
   this->internal_comm_.clear();
-
-  actor_states_.resize(MC_smx_get_maxpid());
+  auto maxpid = mcapi::get().get_maxpid();
+  actor_states_.resize(maxpid);
   /* Stateful model checking */
   if ((_sg_mc_checkpoint > 0 && (state_number % _sg_mc_checkpoint == 0)) || _sg_mc_termination) {
-    system_state_ = std::make_shared<simgrid::mc::Snapshot>(num_);
+    auto snapshot_ptr = mcapi::get().take_snapshot(num_);
+    system_state_ = std::shared_ptr<simgrid::mc::Snapshot>(snapshot_ptr);
     if (_sg_mc_comms_determinism || _sg_mc_send_determinism) {
-      MC_state_copy_incomplete_communications_pattern(this);
-      MC_state_copy_index_communications_pattern(this);
+      mcapi::get().copy_incomplete_comm_pattern(this);
+      mcapi::get().copy_index_comm_pattern(this);
     }
   }
 }