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

Public GIT Repository
MC: isend/irecv are not blocking
[simgrid.git] / src / mc / mc_state.cpp
index a93afe2e061e66e8d6f33fb9e908fa52f2b99816..dff1bee2d8e791c525df84e107c66bbc84b6c940 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2008-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. */
@@ -17,8 +17,7 @@ namespace mc {
 
 State::State(unsigned long state_number) : num_(state_number)
 {
-  this->internal_comm_.clear();
-  auto maxpid = api::get().get_maxpid();
+  const unsigned long maxpid = api::get().get_maxpid();
   actor_states_.resize(maxpid);
   /* Stateful model checking */
   if ((_sg_mc_checkpoint > 0 && (state_number % _sg_mc_checkpoint == 0)) || _sg_mc_termination) {
@@ -44,7 +43,8 @@ Transition State::get_transition() const
 void State::copy_incomplete_comm_pattern()
 {
   incomplete_comm_pattern_.clear();
-  for (unsigned long i = 0; i < api::get().get_maxpid(); i++) {
+  const unsigned long maxpid = api::get().get_maxpid();
+  for (unsigned long i = 0; i < maxpid; i++) {
     std::vector<simgrid::mc::PatternCommunication> res;
     for (auto const& comm : incomplete_communications_pattern[i])
       res.push_back(comm->dup());