1 /* Copyright (c) 2016-2021. 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. */
6 #include "src/mc/VisitedState.hpp"
7 #include "src/mc/checker/Checker.hpp"
8 #include "src/mc/mc_comm_pattern.hpp"
13 #ifndef SIMGRID_MC_COMMUNICATION_DETERMINISM_CHECKER_HPP
14 #define SIMGRID_MC_COMMUNICATION_DETERMINISM_CHECKER_HPP
19 class XBT_PRIVATE CommunicationDeterminismChecker : public Checker {
21 explicit CommunicationDeterminismChecker();
22 ~CommunicationDeterminismChecker() override;
24 RecordTrace get_record_trace() override;
25 std::vector<std::string> get_textual_trace() override;
30 void log_state() override;
31 void deterministic_comm_pattern(aid_t process, const PatternCommunication* comm, int backtracking);
33 void handle_comm_pattern(simgrid::mc::CallType call_type, smx_simcall_t req, int value, int backtracking);
36 // These are used by functions which should be moved in CommunicationDeterminismChecker:
37 void get_comm_pattern(smx_simcall_t request, CallType call_type, int backtracking);
38 void complete_comm_pattern(RemotePtr<kernel::activity::CommImpl> const& comm_addr, aid_t issuer, int backtracking);
41 /** Stack representing the position in the exploration graph */
42 std::list<std::unique_ptr<State>> stack_;
43 VisitedStates visited_states_;
44 unsigned long expanded_states_count_ = 0;
46 bool initial_communications_pattern_done = false;
47 bool recv_deterministic = true;
48 bool send_deterministic = true;
49 char *send_diff = nullptr;
50 char *recv_diff = nullptr;
53 } // namespace simgrid