Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix builds with/without MC and with/without clang (hopefully)
[simgrid.git] / src / mc / Transition.cpp
1 /* Copyright (c) 2015-2022. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #include "src/mc/Transition.hpp"
7 #include "src/mc/TransitionComm.hpp"
8 #include "xbt/asserts.h"
9 #include <simgrid/config.h>
10 #if SIMGRID_HAVE_MC
11 #include "src/mc/ModelChecker.hpp"
12 #endif
13
14 #include <sstream>
15
16 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_transition, mc, "Logging specific to MC transitions");
17
18 namespace simgrid {
19 namespace mc {
20 unsigned long Transition::executed_transitions_ = 0;
21 unsigned long Transition::replayed_transitions_ = 0;
22
23 Transition::~Transition() {
24 } // Make sure that we have a vtable for Transition by putting this virtual function out of the header
25
26 std::string Transition::to_string(bool verbose)
27 {
28   return textual_;
29 }
30 const char* Transition::to_cstring(bool verbose)
31 {
32   to_string();
33   return textual_.c_str();
34 }
35 void Transition::init(aid_t aid, int times_considered)
36 {
37   aid_              = aid;
38   times_considered_ = times_considered;
39 }
40 void Transition::replay() const
41 {
42   replayed_transitions_++;
43
44 #if SIMGRID_HAVE_MC
45   mc_model_checker->handle_simcall(*this, false);
46   mc_model_checker->wait_for_requests();
47 #endif
48 }
49
50 } // namespace mc
51 } // namespace simgrid