X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/02403e880dba3b06f5ac57751f0744475ef77c37..3580b0137eab12ca216d9847823c86918b10dd53:/src/mc/api.hpp diff --git a/src/mc/api.hpp b/src/mc/api.hpp index b2ca63fa58..39d658ef23 100644 --- a/src/mc/api.hpp +++ b/src/mc/api.hpp @@ -10,6 +10,7 @@ #include #include "simgrid/forward.h" +#include "src/mc/Session.hpp" #include "src/mc/api/State.hpp" #include "src/mc/mc_forward.hpp" #include "src/mc/mc_record.hpp" @@ -19,19 +20,7 @@ namespace simgrid { namespace mc { -XBT_DECLARE_ENUM_CLASS(CheckerAlgorithm, Safety, UDPOR, Liveness, CommDeterminism); - -/** - * @brief Maintains the transition's information. - */ -struct s_transition_detail { - simgrid::simix::Simcall call_ = simgrid::simix::Simcall::NONE; - long issuer_id = -1; - RemotePtr mbox_remote_addr {}; // used to represent mailbox remote address for isend and ireceive transitions - RemotePtr comm_remote_addr {}; // the communication this transition concerns (to be used only for isend, ireceive, wait and test) -}; - -using transition_detail_t = std::unique_ptr; +XBT_DECLARE_ENUM_CLASS(ExplorationAlgorithm, Safety, UDPOR, Liveness, CommDeterminism); /* ** This class aimes to implement FACADE APIs for simgrid. The FACADE layer sits between the CheckerSide @@ -52,10 +41,9 @@ private: } }; -public: - std::string get_actor_string(smx_actor_t actor) const; - std::string get_actor_dot_label(smx_actor_t actor) const; + std::unique_ptr session_; +public: // No copy: Api(Api const&) = delete; void operator=(Api const&) = delete; @@ -66,16 +54,12 @@ public: return api; } - simgrid::mc::Checker* initialize(char** argv, simgrid::mc::CheckerAlgorithm algo) const; + simgrid::mc::Exploration* initialize(char** argv, simgrid::mc::ExplorationAlgorithm algo); // ACTOR APIs std::vector& get_actors() const; unsigned long get_maxpid() const; - // COMMUNICATION APIs - xbt::string const& get_actor_name(smx_actor_t actor) const; - xbt::string const& get_actor_host_name(smx_actor_t actor) const; - // REMOTE APIs std::size_t get_remote_heap_bytes() const; @@ -84,9 +68,6 @@ public: unsigned long mc_get_visited_states() const; XBT_ATTRIB_NORETURN void mc_exit(int status) const; - // SIMCALL APIs - std::string request_get_dot_output(const Transition* t) const; - // STATE APIs void restore_state(std::shared_ptr system_state) const; @@ -95,12 +76,11 @@ public: simgrid::mc::Snapshot* take_snapshot(long num_state) const; // SESSION APIs - void s_close() const; + simgrid::mc::Session const& get_session() const { return *session_; } + void s_close(); -// AUTOMATION APIs -#if SIMGRID_HAVE_MC + // AUTOMATION APIs void automaton_load(const char* file) const; -#endif std::vector automaton_propositional_symbol_evaluate() const; std::vector get_automaton_state() const; int compare_automaton_exp_label(const xbt_automaton_exp_label* l) const; @@ -109,15 +89,8 @@ public: { return DerefAndCompareByActorsCountAndUsedHeap(); } - inline int automaton_state_compare(const_xbt_automaton_state_t const& s1, const_xbt_automaton_state_t const& s2) const - { - return xbt_automaton_state_compare(s1, s2); - } xbt_automaton_exp_label_t get_automaton_transition_label(xbt_dynar_t const& dynar, int index) const; xbt_automaton_state_t get_automaton_transition_dst(xbt_dynar_t const& dynar, int index) const; - - // DYNAR APIs - inline unsigned long get_dynar_length(const_xbt_dynar_t const& dynar) const { return xbt_dynar_length(dynar); } }; } // namespace mc