X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5f4e5ebf04edc2c9e91429952943a41b86dd0bb9..39c935d6d5ee86d153f6f7e6a10d723ae7c57f6f:/src/mc/mc_state.cpp diff --git a/src/mc/mc_state.cpp b/src/mc/mc_state.cpp index c078742b53..6125c5e12f 100644 --- a/src/mc/mc_state.cpp +++ b/src/mc/mc_state.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2008-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. */ @@ -25,8 +25,8 @@ State::State(unsigned long state_number) : num_(state_number) auto snapshot_ptr = mcapi::get().take_snapshot(num_); system_state_ = std::shared_ptr(snapshot_ptr); if (_sg_mc_comms_determinism || _sg_mc_send_determinism) { - mcapi::get().copy_incomplete_comm_pattern(this); - mcapi::get().copy_index_comm_pattern(this); + copy_incomplete_comm_pattern(); + copy_index_comm_pattern(); } } } @@ -41,5 +41,23 @@ Transition State::get_transition() const return this->transition_; } +void State::copy_incomplete_comm_pattern() +{ + incomplete_comm_pattern_.clear(); + for (unsigned long i = 0; i < mcapi::get().get_maxpid(); i++) { + std::vector res; + for (auto const& comm : incomplete_communications_pattern[i]) + res.push_back(comm->dup()); + incomplete_comm_pattern_.push_back(std::move(res)); + } +} + +void State::copy_index_comm_pattern() +{ + communication_indices_.clear(); + for (auto const& list_process_comm : initial_communications_pattern) + this->communication_indices_.push_back(list_process_comm.index_comm); +} + } }