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/mc_forward.hpp"
13 #include "src/mc/Checker.hpp"
14 #include "src/mc/VisitedState.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 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(
39 xbt_dynar_t list, simgrid::mc::RemotePtr<simgrid::kernel::activity::Comm> comm_addr,
40 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 int initial_communications_pattern_done = 0;
48 int recv_deterministic = 0;
49 int send_deterministic = 0;
50 char *send_diff = nullptr;
51 char *recv_diff = nullptr;