this->close();
}
-/** Take the initial snapshot of the application, that must be stopped. */
-void Session::initialize()
+/** The application must be stopped. */
+void Session::take_initial_snapshot()
{
xbt_assert(initial_snapshot_ == nullptr);
model_checker_->wait_for_requests();
~Session();
void close();
- void initialize();
+ void take_initial_snapshot();
void execute(Transition const& transition) const;
void log_state() const;
return heap_bytes_used;
}
-void Api::session_initialize() const
-{
- session->initialize();
-}
-
void Api::mc_inc_visited_states() const
{
mc_model_checker->visited_states++;
session->close();
}
-void Api::restore_initial_state() const
-{
- session->restore_initial_state();
-}
-
void Api::execute(Transition& transition, smx_simcall_t simcall) const
{
/* FIXME: once all simcalls have observers, kill the simcall parameter and use mc_model_checker->simcall_to_string() */
// STATE APIs
void restore_state(std::shared_ptr<simgrid::mc::Snapshot> system_state) const;
void log_state() const;
- void restore_initial_state() const;
// SNAPSHOT APIs
bool snapshot_equal(const Snapshot* s1, const Snapshot* s2) const;
simgrid::mc::Snapshot* take_snapshot(int num_state) const;
// SESSION APIs
- void session_initialize() const;
void s_close() const;
void execute(Transition& transition, smx_simcall_t simcall) const;
#include "src/mc/checker/CommunicationDeterminismChecker.hpp"
#include "src/kernel/activity/MailboxImpl.hpp"
+#include "src/mc/Session.hpp"
#include "src/mc/mc_config.hpp"
#include "src/mc/mc_exit.hpp"
#include "src/mc/mc_private.hpp"
return;
}
- /* Restore the initial state */
- api::get().restore_initial_state();
+ session->restore_initial_state();
const unsigned long maxpid = api::get().get_maxpid();
assert(maxpid == incomplete_communications_pattern.size());
void CommunicationDeterminismChecker::run()
{
XBT_INFO("Check communication determinism");
- api::get().session_initialize();
+ get_session()->take_initial_snapshot();
this->prepare();
this->real_run();
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/mc/checker/LivenessChecker.hpp"
+#include "src/mc/Session.hpp"
#include "src/mc/mc_config.hpp"
#include "src/mc/mc_exit.hpp"
#include "src/mc/mc_private.hpp"
}
}
- /* Restore the initial state */
- api::get().restore_initial_state();
+ session->restore_initial_state();
/* Traverse the stack from the initial state and re-execute the transitions */
int depth = 1;
api::get().automaton_load(_sg_mc_property_file.get().c_str());
XBT_DEBUG("Starting the liveness algorithm");
- api::get().session_initialize();
+ get_session()->take_initial_snapshot();
/* Initialize */
this->previous_pair_ = 0;
#include <xbt/log.h>
#include <xbt/sysdep.h>
+#include "src/mc/Session.hpp"
#include "src/mc/Transition.hpp"
#include "src/mc/VisitedState.hpp"
#include "src/mc/checker/SafetyChecker.hpp"
return;
}
- /* Restore the initial state */
- api::get().restore_initial_state();
+ session->restore_initial_state();
/* Traverse the stack from the state at position start and re-execute the transitions */
for (std::unique_ptr<State> const& state : stack_) {
XBT_INFO("Check a safety property. Reduction is: %s.",
(reductionMode_ == ReductionMode::none ? "none"
: (reductionMode_ == ReductionMode::dpor ? "dpor" : "unknown")));
-
- api::get().session_initialize();
+
+ get_session()->take_initial_snapshot();
XBT_DEBUG("Starting the safety algorithm");