1 /* Copyright (c) 2016. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
12 #include "src/mc/VisitedState.hpp"
13 #include "src/mc/checker/Checker.hpp"
14 #include "src/mc/mc_comm_pattern.h"
15 #include "src/mc/mc_forward.hpp"
17 #ifndef SIMGRID_MC_COMMUNICATION_DETERMINISM_CHECKER_HPP
18 #define SIMGRID_MC_COMMUNICATION_DETERMINISM_CHECKER_HPP
23 class XBT_PRIVATE CommunicationDeterminismChecker : public Checker {
25 CommunicationDeterminismChecker(Session& session);
26 ~CommunicationDeterminismChecker();
28 RecordTrace getRecordTrace() override;
29 std::vector<std::string> getTextualTrace() override;
33 void logState() override;
34 void deterministic_comm_pattern(int process, simgrid::mc::PatternCommunication* comm, int backtracking);
37 // These are used by functions which should be moved in CommunicationDeterminismChecker:
38 void get_comm_pattern(xbt_dynar_t list, smx_simcall_t request, e_mc_call_type_t call_type, int backtracking);
39 void complete_comm_pattern(
40 xbt_dynar_t list, simgrid::mc::RemotePtr<simgrid::kernel::activity::Comm> comm_addr,
41 unsigned int issuer, int backtracking);
43 /** Stack representing the position in the exploration graph */
44 std::list<std::unique_ptr<simgrid::mc::State>> stack_;
45 simgrid::mc::VisitedStates visitedStates_;
46 unsigned long expandedStatesCount_ = 0;
48 bool initial_communications_pattern_done = false;
49 bool recv_deterministic = true;
50 bool send_deterministic = true;
51 char *send_diff = nullptr;
52 char *recv_diff = nullptr;