Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of framagit.org:simgrid/simgrid
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 1 Aug 2022 22:21:42 +0000 (00:21 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 1 Aug 2022 22:21:42 +0000 (00:21 +0200)
src/kernel/actor/CommObserver.cpp
src/kernel/actor/CommObserver.hpp
src/kernel/actor/SimcallObserver.cpp
src/kernel/actor/SimcallObserver.hpp
src/mc/mc_base.cpp
src/mc/remote/RemoteProcess.cpp
src/mc/remote/RemoteProcess.hpp

index f44571e..e15d6aa 100644 (file)
@@ -18,16 +18,16 @@ namespace simgrid::kernel::actor {
 
 ActivityTestanySimcall::ActivityTestanySimcall(ActorImpl* actor, const std::vector<activity::ActivityImpl*>& activities)
     : ResultingSimcall(actor, -1), activities_(activities)
-{
-}
-
-int ActivityTestanySimcall::get_max_consider()
 {
   indexes_.clear();
   // list all the activities that are ready
   for (unsigned i = 0; i < activities_.size(); i++)
     if (activities_[i]->test(get_issuer()))
       indexes_.push_back(i);
+}
+
+int ActivityTestanySimcall::get_max_consider() const
+{
   return indexes_.size() + 1;
 }
 
@@ -94,6 +94,11 @@ ActivityWaitanySimcall::ActivityWaitanySimcall(ActorImpl* actor, const std::vect
                                                double timeout)
     : ResultingSimcall(actor, -1), activities_(activities), timeout_(timeout)
 {
+  // list all the activities that are ready
+  indexes_.clear();
+  for (unsigned i = 0; i < activities_.size(); i++)
+    if (activities_[i]->test(get_issuer()))
+      indexes_.push_back(i);
 }
 
 bool ActivityWaitSimcall::is_enabled()
@@ -119,14 +124,8 @@ bool ActivityWaitanySimcall::is_enabled()
   return not indexes_.empty();
 }
 
-int ActivityWaitanySimcall::get_max_consider()
+int ActivityWaitanySimcall::get_max_consider() const
 {
-  // list all the activities that are ready
-  indexes_.clear();
-  for (unsigned i = 0; i < activities_.size(); i++)
-    if (activities_[i]->test(get_issuer()))
-      indexes_.push_back(i);
-
   int res = indexes_.size();
   //  if (_sg_mc_timeout && timeout_)
   //    res++;
index 9cba17d..41607aa 100644 (file)
@@ -38,7 +38,7 @@ public:
   bool is_visible() const override { return true; }
   bool is_enabled() override { return true; /* can return -1 if no activity is ready */ }
   void serialize(std::stringstream& stream) const override;
-  int get_max_consider() override;
+  int get_max_consider() const override;
   void prepare(int times_considered) override;
   const std::vector<activity::ActivityImpl*>& get_activities() const { return activities_; }
   int get_value() const { return next_value_; }
@@ -73,7 +73,7 @@ public:
   void serialize(std::stringstream& stream) const override;
   bool is_visible() const override { return true; }
   void prepare(int times_considered) override;
-  int get_max_consider() override;
+  int get_max_consider() const override;
   const std::vector<activity::ActivityImpl*>& get_activities() const { return activities_; }
   double get_timeout() const { return timeout_; }
   int get_value() const { return next_value_; }
index e4ffca2..87991cc 100644 (file)
@@ -32,7 +32,7 @@ void RandomSimcall::prepare(int times_considered)
   XBT_DEBUG("MC_RANDOM(%d, %d) will return %d after %d times", min_, max_, next_value_, times_considered);
 }
 
-int RandomSimcall::get_max_consider()
+int RandomSimcall::get_max_consider() const
 {
   return max_ - min_ + 1;
 }
index 6eabf88..a4095e4 100644 (file)
@@ -37,7 +37,7 @@ public:
    * If it's more than one (as with mc_random or waitany), we need to consider this transition several times to start
    * differing branches
    */
-  virtual int get_max_consider() { return 1; }
+  virtual int get_max_consider() const { return 1; }
 
   /** Prepares the simcall to be used.
    *
@@ -83,7 +83,7 @@ public:
     xbt_assert(min < max);
   }
   void serialize(std::stringstream& stream) const override;
-  int get_max_consider() override;
+  int get_max_consider() const override;
   void prepare(int times_considered) override;
   int get_value() const { return next_value_; }
 };
index 93eef1a..a35833c 100644 (file)
@@ -40,9 +40,7 @@ namespace simgrid::mc {
 void execute_actors()
 {
   auto* engine = kernel::EngineImpl::get_instance();
-#if SIMGRID_HAVE_MC
-  xbt_assert(mc_model_checker == nullptr, "This must be called from the client");
-#endif
+
   while (engine->has_actors_to_run()) {
     engine->run_all_actors();
     for (auto const& actor : engine->get_actors_that_ran()) {
index 2256c47..ac1e9b2 100644 (file)
@@ -117,7 +117,6 @@ void RemoteProcess::init(xbt_mheap_t mmalloc_default_mdp, unsigned long* maxpid)
   xbt_assert(fd >= 0, "Could not open file for process virtual address space");
   this->memory_file = fd;
 
-  this->smx_actors_infos.clear();
   this->unw_addr_space            = simgrid::mc::UnwindContext::createUnwindAddressSpace();
   this->unw_underlying_addr_space = simgrid::unw::create_addr_space();
   this->unw_underlying_context    = simgrid::unw::create_context(this->unw_underlying_addr_space, this->pid_);
index 924aa56..b2c7558 100644 (file)
@@ -184,13 +184,6 @@ private:
   std::vector<s_stack_region_t> stack_areas_;
   std::vector<IgnoredHeapRegion> ignored_heap_;
 
-  // Copies of MCed SMX data structures
-  /** Copy of `EngineImpl::actor_list_`
-   *
-   *  See mc_smx.cpp.
-   */
-  std::vector<ActorInformation> smx_actors_infos;
-
   /** State of the cache (which variables are up to date) */
   int cache_flags_ = RemoteProcess::cache_none;