]> AND Public Git Repository - simgrid.git/blobdiff - src/mc/mc_pattern.hpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix MC builds with gcc12 (and make the serialization more robust)
[simgrid.git] / src / mc / mc_pattern.hpp
index 79bcd24b84bd6e9d73ee87e1b4cfb8022d7b7577..ba2f56037560ba55c49d318814fac4a893fd58c8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2022. 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. */
@@ -7,6 +7,7 @@
 #define SIMGRID_MC_PATTERN_H
 
 #include "src/kernel/activity/CommImpl.hpp"
+#include "src/mc/remote/RemotePtr.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -24,8 +25,6 @@ public:
   PatternCommunicationType type = PatternCommunicationType::send;
   unsigned long src_proc        = 0;
   unsigned long dst_proc        = 0;
-  const xbt::string* src_host   = nullptr;
-  const xbt::string* dst_host   = nullptr;
   std::string rdv;
   std::vector<char> data;
   int tag   = 0;
@@ -40,7 +39,6 @@ public:
     // src_proc?
     // dst_proc?
     res.dst_proc = this->dst_proc;
-    res.dst_host = this->dst_host;
     res.rdv      = this->rdv;
     res.data     = this->data;
     // tag?
@@ -67,23 +65,25 @@ class ActorState {
   };
 
   /** Exploration control information */
-  InterleavingType state = InterleavingType::disabled;
+  InterleavingType state_ = InterleavingType::disabled;
 
-public:
   /** Number of times that the process was considered to be executed */
-  // TODO, make this private
-  unsigned int times_considered = 0;
+  unsigned int times_considered_ = 0;
+
+public:
+  unsigned int get_times_considered() const { return times_considered_; }
+  unsigned int get_times_considered_and_inc() { return times_considered_++; }
 
-  bool is_disabled() const { return this->state == InterleavingType::disabled; }
-  bool is_done() const { return this->state == InterleavingType::done; }
-  bool is_todo() const { return this->state == InterleavingType::todo; }
+  bool is_disabled() const { return this->state_ == InterleavingType::disabled; }
+  bool is_done() const { return this->state_ == InterleavingType::done; }
+  bool is_todo() const { return this->state_ == InterleavingType::todo; }
   /** Mark that we should try executing this process at some point in the future of the checker algorithm */
   void mark_todo()
   {
-    this->state            = InterleavingType::todo;
-    this->times_considered = 0;
+    this->state_            = InterleavingType::todo;
+    this->times_considered_ = 0;
   }
-  void set_done() { this->state = InterleavingType::done; }
+  void set_done() { this->state_ = InterleavingType::done; }
 };
 
 } // namespace mc