From: Gabriel Corona Date: Wed, 13 Apr 2016 09:53:07 +0000 (+0200) Subject: [mc] Add methods to Session X-Git-Tag: v3_13~97^2~16 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6911eb2e056c44491f399b63c663f4b897aaba76?hp=0caecdf74ead0d19cc3b13eeb96dcd206243d71e [mc] Add methods to Session --- diff --git a/src/mc/SafetyChecker.cpp b/src/mc/SafetyChecker.cpp index 7a28d281eb..698b546327 100644 --- a/src/mc/SafetyChecker.cpp +++ b/src/mc/SafetyChecker.cpp @@ -26,6 +26,7 @@ #include "src/mc/SafetyChecker.hpp" #include "src/mc/VisitedState.hpp" #include "src/mc/Transition.hpp" +#include "src/mc/Session.hpp" #include "src/xbt/mmalloc/mmprivate.h" @@ -116,26 +117,20 @@ int SafetyChecker::run() continue; } - int req_num = state->transition.argument; - // If there are processes to interleave and the maximum depth has not been // reached then perform one step of the exploration algorithm. XBT_DEBUG("Execute: %s", simgrid::mc::request_to_string( - req, req_num, simgrid::mc::RequestType::simix).c_str()); + req, state->transition.argument, simgrid::mc::RequestType::simix).c_str()); std::string req_str; if (dot_output != nullptr) - req_str = simgrid::mc::request_get_dot_output(req, req_num); + req_str = simgrid::mc::request_get_dot_output(req, state->transition.argument); mc_stats->executed_transitions++; - // TODO, bundle both operations in a single message - // MC_execute_transition(req, req_num) - /* Answer the request */ - mc_model_checker->handle_simcall(state->transition); - mc_model_checker->wait_for_requests(); + this->getSession().execute(state->transition); /* Create the new expanded state */ std::unique_ptr next_state = diff --git a/src/mc/Session.cpp b/src/mc/Session.cpp index 63c0c7483b..842fa3c86a 100644 --- a/src/mc/Session.cpp +++ b/src/mc/Session.cpp @@ -94,6 +94,12 @@ Session::~Session() this->close(); } +void Session::execute(Transition const& transition) +{ + modelChecker_->handle_simcall(transition); + modelChecker_->wait_for_requests(); +} + // static Session* Session::fork(std::function code) { diff --git a/src/mc/Session.hpp b/src/mc/Session.hpp index 9b7d857c13..23e3eaa6f2 100644 --- a/src/mc/Session.hpp +++ b/src/mc/Session.hpp @@ -49,6 +49,9 @@ public: ~Session(); void close(); +public: + void execute(Transition const& transition); + public: // static constructors /** Create a new session by forking