* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/activity/MailboxImpl.hpp"
-#include "src/mc/explo/SafetyChecker.hpp"
+#include "src/mc/explo/DFSExplorer.hpp"
#include "src/mc/mc_config.hpp"
#include "src/mc/mc_exit.hpp"
#include "src/mc/mc_forward.hpp"
/********** State Extension ***********/
class StateCommDet {
- CommDetExtension* checker_;
-
public:
std::vector<std::vector<simgrid::mc::PatternCommunication>> incomplete_comm_pattern_;
std::vector<unsigned> communication_indices_;
static simgrid::xbt::Extension<simgrid::mc::State, StateCommDet> EXTENSION_ID;
- explicit StateCommDet(CommDetExtension* checker) : checker_(checker)
+ explicit StateCommDet(CommDetExtension* checker)
{
const unsigned long maxpid = Api::get().get_maxpid();
for (unsigned long i = 0; i < maxpid; i++) {
std::vector<simgrid::mc::PatternCommunication> res;
- for (auto const& comm : checker_->incomplete_communications_pattern[i])
+ for (auto const& comm : checker->incomplete_communications_pattern[i])
res.push_back(comm->dup());
incomplete_comm_pattern_.push_back(std::move(res));
}
- for (auto const& list_process_comm : checker_->initial_communications_pattern)
+ for (auto const& list_process_comm : checker->initial_communications_pattern)
this->communication_indices_.push_back(list_process_comm.index_comm);
}
};
switch (transition->type_) {
case Transition::Type::COMM_SEND:
- get_comm_pattern(transition);
- break;
case Transition::Type::COMM_RECV:
get_comm_pattern(transition);
break;
auto extension = new CommDetExtension();
- SafetyChecker::on_exploration_start([extension]() {
+ DFSExplorer::on_exploration_start([extension]() {
XBT_INFO("Check communication determinism");
extension->exploration_start();
});
- SafetyChecker::on_backtracking([extension]() { extension->initial_communications_pattern_done = true; });
- SafetyChecker::on_state_creation([extension](State* state) { state->extension_set(new StateCommDet(extension)); });
+ DFSExplorer::on_backtracking([extension]() { extension->initial_communications_pattern_done = true; });
+ DFSExplorer::on_state_creation([extension](State* state) { state->extension_set(new StateCommDet(extension)); });
- SafetyChecker::on_restore_system_state(
- [extension](State* state) { extension->restore_communications_pattern(state); });
+ DFSExplorer::on_restore_system_state([extension](State* state) { extension->restore_communications_pattern(state); });
- SafetyChecker::on_restore_initial_state([extension]() {
+ DFSExplorer::on_restore_initial_state([extension]() {
const unsigned long maxpid = Api::get().get_maxpid();
assert(maxpid == extension->incomplete_communications_pattern.size());
assert(maxpid == extension->initial_communications_pattern.size());
}
});
- SafetyChecker::on_transition_replay([extension](Transition* t) { extension->handle_comm_pattern(t); });
- SafetyChecker::on_transition_execute([extension](Transition* t) { extension->handle_comm_pattern(t); });
+ DFSExplorer::on_transition_replay([extension](Transition* t) { extension->handle_comm_pattern(t); });
+ DFSExplorer::on_transition_execute([extension](Transition* t) { extension->handle_comm_pattern(t); });
- SafetyChecker::on_log_state([extension]() {
+ DFSExplorer::on_log_state([extension]() {
if (_sg_mc_comms_determinism) {
if (extension->send_deterministic && not extension->recv_deterministic) {
XBT_INFO("*******************************************************");
delete extension;
});
- return new SafetyChecker(session);
+ return new DFSExplorer(session);
}
} // namespace mc