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"
17 ** This class aimes to implement FACADE APIs for simgrid. The FACADE layer sits between the CheckerSide
18 ** (Unfolding_Checker, DPOR, ...) layer and the
19 ** AppSide layer. The goal is to drill down into the entagled details in the CheckerSide layer and break down the
20 ** detailes in a way that the CheckerSide eventually
21 ** be capable to acquire the required information through the FACADE layer rather than the direct access to the AppSide.
30 mc_api(mc_api const&) = delete;
31 void operator=(mc_api const&) = delete;
39 void initialize(char** argv);
42 std::vector<simgrid::mc::ActorInformation>& get_actors() const;
43 bool actor_is_enabled(aid_t pid) const;
44 unsigned long get_maxpid() const;
47 void copy_incomplete_comm_pattern(const simgrid::mc::State* state) const;
48 void copy_index_comm_pattern(const simgrid::mc::State* state) const;
49 kernel::activity::CommImpl* get_pattern_comm_addr(smx_simcall_t request) const;
50 std::string get_pattern_comm_rdv(void* addr) const;
51 unsigned long get_pattern_comm_src_proc(void* addr) const;
52 unsigned long get_pattern_comm_dst_proc(void* addr) const;
53 std::vector<char> get_pattern_comm_data(void* addr) const;
54 const char* get_actor_host_name(smx_actor_t actor) const;
55 bool check_send_request_detached(smx_simcall_t const& simcall) const;
58 std::size_t get_remote_heap_bytes() const;
60 // MODEL_CHECKER FUNCTIONS
61 ModelChecker* get_model_checker() const;
62 void mc_inc_visited_states() const;
63 void mc_inc_executed_trans() const;
64 unsigned long mc_get_visited_states() const;
65 unsigned long mc_get_executed_trans() const;
66 bool mc_check_deadlock() const;
67 void mc_show_deadlock() const;
68 smx_actor_t mc_smx_simcall_get_issuer(s_smx_simcall const* req) const;
69 bool mc_is_null() const;
70 Checker* mc_get_checker() const;
71 RemoteSimulation& mc_get_remote_simulation() const;
72 void handle_simcall(Transition const& transition) const;
73 void mc_wait_for_requests() const;
74 void mc_exit(int status) const;
75 std::string const& mc_get_host_name(std::string const& hostname) const;
76 void mc_dump_record_path() const;
77 smx_simcall_t mc_state_choose_request(simgrid::mc::State* state) const;
80 bool request_depend(smx_simcall_t req1, smx_simcall_t req2) const;
81 std::string request_to_string(smx_simcall_t req, int value, RequestType request_type) const;
82 std::string request_get_dot_output(smx_simcall_t req, int value) const;
83 const char *simix_simcall_name(simgrid::simix::Simcall kind) const;
85 int get_smpi_request_tag(smx_simcall_t const& simcall, simgrid::simix::Simcall type) const;
89 bool snapshot_equal(const Snapshot* s1, const Snapshot* s2) const;
90 simgrid::mc::Snapshot* take_snapshot(int num_state) const;
93 void s_initialize() const;
95 void s_restore_initial_state() const;
96 void execute(Transition const& transition);
97 void s_log_state() const;
101 } // namespace simgrid