1 #ifndef SIMGRID_MC_API_HPP
2 #define SIMGRID_MC_API_HPP
7 #include "simgrid/forward.h"
8 #include "src/mc/mc_forward.hpp"
9 #include "src/mc/mc_request.hpp"
10 #include "src/mc/mc_state.hpp"
11 #include "xbt/automaton.hpp"
18 ** This class aimes to implement FACADE APIs for simgrid. The FACADE layer sits between the CheckerSide
19 ** (Unfolding_Checker, DPOR, ...) layer and the
20 ** AppSide layer. The goal is to drill down into the entagled details in the CheckerSide layer and break down the
21 ** detailes in a way that the CheckerSide eventually
22 ** be capable to acquire the required information through the FACADE layer rather than the direct access to the AppSide.
31 mc_api(mc_api const&) = delete;
32 void operator=(mc_api const&) = delete;
40 void initialize(char** argv);
43 std::vector<simgrid::mc::ActorInformation>& get_actors() const;
44 bool actor_is_enabled(aid_t pid) const;
45 unsigned long get_maxpid() const;
46 int get_actors_size() const;
49 bool comm_addr_equal(const kernel::activity::CommImpl* comm_addr1, const kernel::activity::CommImpl* comm_addr2) const;
50 kernel::activity::CommImpl* get_comm_isend_raw_addr(smx_simcall_t request) const;
51 kernel::activity::CommImpl* get_comm_wait_raw_addr(smx_simcall_t request) const;
52 kernel::activity::CommImpl* get_comm_waitany_raw_addr(smx_simcall_t request, int value) const;
53 std::string get_pattern_comm_rdv(void* addr) const;
54 unsigned long get_pattern_comm_src_proc(void* addr) const;
55 unsigned long get_pattern_comm_dst_proc(void* addr) const;
56 std::vector<char> get_pattern_comm_data(void* addr) const;
57 std::vector<char> get_pattern_comm_data(const kernel::activity::CommImpl* comm_addr) const;
58 const char* get_actor_host_name(smx_actor_t actor) const;
60 bool check_send_request_detached(smx_simcall_t const& simcall) const;
62 smx_actor_t get_src_actor(const kernel::activity::CommImpl* comm_addr) const;
63 smx_actor_t get_dst_actor(const kernel::activity::CommImpl* comm_addr) const;
66 std::size_t get_remote_heap_bytes() const;
69 ModelChecker* get_model_checker() const;
70 void mc_inc_visited_states() const;
71 void mc_inc_executed_trans() const;
72 unsigned long mc_get_visited_states() const;
73 unsigned long mc_get_executed_trans() const;
74 bool mc_check_deadlock() const;
75 void mc_show_deadlock() const;
76 bool mc_is_null() const;
77 Checker* mc_get_checker() const;
78 RemoteSimulation& mc_get_remote_simulation() const;
79 void handle_simcall(Transition const& transition) const;
80 void mc_wait_for_requests() const;
81 XBT_ATTRIB_NORETURN void mc_exit(int status) const;
82 std::string const& mc_get_host_name(std::string const& hostname) const;
83 void dump_record_path() const;
84 smx_simcall_t mc_state_choose_request(simgrid::mc::State* state) const;
87 bool request_depend(smx_simcall_t req1, smx_simcall_t req2) const;
88 std::string request_to_string(smx_simcall_t req, int value, RequestType request_type) const;
89 std::string request_get_dot_output(smx_simcall_t req, int value) const;
90 const char *simcall_get_name(simgrid::simix::Simcall kind) const;
91 smx_actor_t simcall_get_issuer(s_smx_simcall const* req) const;
93 int get_smpi_request_tag(smx_simcall_t const& simcall, simgrid::simix::Simcall type) const;
97 void restore_state(std::shared_ptr<simgrid::mc::Snapshot> system_state) const;
98 void log_state() const;
99 void restore_initial_state() const;
102 bool snapshot_equal(const Snapshot* s1, const Snapshot* s2) const;
103 simgrid::mc::Snapshot* take_snapshot(int num_state) const;
106 void session_initialize() const;
107 void s_close() const;
108 void execute(Transition const& transition) const;
112 void automaton_load(const char *file) const;
114 std::vector<int> automaton_propositional_symbol_evaluate() const;
115 std::vector<xbt_automaton_state_t> get_automaton_state() const;
116 int compare_automaton_exp_lable(const xbt_automaton_exp_label* l, std::vector<int> const& values) const;
121 } // namespace simgrid