1 /* Copyright (c) 2016-2017. The SimGrid Team. All rights reserved. */
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. */
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"
16 #ifndef SIMGRID_MC_COMMUNICATION_DETERMINISM_CHECKER_HPP
17 #define SIMGRID_MC_COMMUNICATION_DETERMINISM_CHECKER_HPP
22 class XBT_PRIVATE CommunicationDeterminismChecker : public Checker {
24 explicit CommunicationDeterminismChecker(Session& session);
25 ~CommunicationDeterminismChecker();
27 RecordTrace getRecordTrace() override;
28 std::vector<std::string> getTextualTrace() override;
32 void logState() override;
33 void deterministic_comm_pattern(int process, simgrid::mc::PatternCommunication* comm, int backtracking);
36 // These are used by functions which should be moved in CommunicationDeterminismChecker:
37 void get_comm_pattern(xbt_dynar_t list, smx_simcall_t request, e_mc_call_type_t call_type, int backtracking);
38 void complete_comm_pattern(xbt_dynar_t list, simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> comm_addr,
39 unsigned int issuer, int backtracking);
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;
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;