-/* Copyright (c) 2008-2015. The SimGrid Team.
+/* Copyright (c) 2016. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include "src/mc/mc_smx.h"
#include "src/mc/Client.hpp"
#include "src/mc/mc_exit.h"
+#include "src/mc/Checker.hpp"
+#include "src/mc/SafetyChecker.hpp"
#include "src/xbt/mmalloc/mmprivate.h"
/** \brief Model-check the application using a DFS exploration
* with DPOR (Dynamic Partial Order Reductions)
*/
-int modelcheck_safety(void)
+static int modelcheck_safety(void)
{
modelcheck_safety_init();
initial_global_state->snapshot = simgrid::mc::take_snapshot(0);
}
+SafetyChecker::SafetyChecker(Session& session) : Checker(session)
+{
+}
+
+SafetyChecker::~SafetyChecker()
+{
+}
+
+int SafetyChecker::run()
+{
+ return simgrid::mc::modelcheck_safety();
+}
+
}
}
--- /dev/null
+/* Copyright (c) 2008-2016. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef SIMGRID_MC_SAFETY_CHECKER_HPP
+#define SIMGRID_MC_SAFETY_CHECKER_HPP
+
+#include "src/mc/mc_forward.hpp"
+#include "src/mc/Checker.hpp"
+
+namespace simgrid {
+namespace mc {
+
+class SafetyChecker : public Checker {
+public:
+ SafetyChecker(Session& session);
+ ~SafetyChecker();
+ int run() override;
+};
+
+}
+}
+
+#endif
extern XBT_PRIVATE simgrid::mc::ReductionMode reduction_mode;
-int modelcheck_safety(void);
-
struct XBT_PRIVATE VisitedState {
simgrid::mc::Snapshot* system_state = nullptr;
size_t heap_bytes_used = 0;
#include "src/mc/mc_exit.h"
#include "src/mc/Session.hpp"
#include "src/mc/Checker.hpp"
+#include "src/mc/SafetyChecker.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_main, mc, "Entry point for simgrid-mc");
code = [](Session& session) {
return MC_modelcheck_comm_determinism(); };
else if (!_sg_mc_property_file || _sg_mc_property_file[0] == '\0')
- code = [](Session& session) {
- return simgrid::mc::modelcheck_safety(); };
+ return std::unique_ptr<simgrid::mc::Checker>(
+ new simgrid::mc::SafetyChecker(session));
else
code = [](Session& session) {
return simgrid::mc::modelcheck_liveness(); };
src/mc/ObjectInformation.cpp
src/mc/PageStore.hpp
src/mc/PageStore.cpp
+ src/mc/SafetyChecker.cpp
+ src/mc/SafetyChecker.hpp
src/mc/ChunkedData.hpp
src/mc/ChunkedData.cpp
src/mc/RegionSnapshot.cpp
src/mc/mc_request.h
src/mc/mc_request.cpp
src/mc/mc_safety.h
- src/mc/mc_safety.cpp
src/mc/mc_state.h
src/mc/mc_state.cpp
src/mc/mc_visited.cpp