Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill unused parameter and please Sonar.
[simgrid.git] / src / mc / checker / CommunicationDeterminismChecker.hpp
1 /* Copyright (c) 2016-2019. 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 <list>
7 #include <memory>
8 #include <string>
9 #include <vector>
10
11 #include "src/mc/VisitedState.hpp"
12 #include "src/mc/checker/Checker.hpp"
13 #include "src/mc/mc_comm_pattern.hpp"
14 #include "src/mc/mc_forward.hpp"
15
16 #ifndef SIMGRID_MC_COMMUNICATION_DETERMINISM_CHECKER_HPP
17 #define SIMGRID_MC_COMMUNICATION_DETERMINISM_CHECKER_HPP
18
19 namespace simgrid {
20 namespace mc {
21
22 class XBT_PRIVATE CommunicationDeterminismChecker : public Checker {
23 public:
24   explicit CommunicationDeterminismChecker(Session& session);
25   ~CommunicationDeterminismChecker();
26   void run() override;
27   RecordTrace getRecordTrace() override;
28   std::vector<std::string> getTextualTrace() override;
29 private:
30   void prepare();
31   void real_run();
32   void logState() override;
33   void deterministic_comm_pattern(int process, simgrid::mc::PatternCommunication* comm, int backtracking);
34   void restoreState();
35 public:
36   // These are used by functions which should be moved in CommunicationDeterminismChecker:
37   void get_comm_pattern(smx_simcall_t request, e_mc_call_type_t call_type, int backtracking);
38   void complete_comm_pattern(simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> comm_addr, unsigned int issuer,
39                              int backtracking);
40
41 private:
42   /** Stack representing the position in the exploration graph */
43   std::list<std::unique_ptr<simgrid::mc::State>> stack_;
44   simgrid::mc::VisitedStates visitedStates_;
45   unsigned long expandedStatesCount_ = 0;
46
47   bool initial_communications_pattern_done = false;
48   bool recv_deterministic                  = true;
49   bool send_deterministic                  = true;
50   char *send_diff = nullptr;
51   char *recv_diff = nullptr;
52 };
53
54 #endif
55
56 }
57 }