-/* Copyright (c) 2016. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2016-2017. 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. */
#include "src/mc/mc_private.h"
#include "src/mc/mc_record.h"
#include "src/mc/mc_request.h"
-#include "src/mc/mc_safety.h"
#include "src/mc/mc_smx.h"
-#include "src/mc/mc_state.h"
-#include "src/mc/remote/Client.hpp"
#include "src/xbt/mmalloc/mmprivate.h"
simgrid::mc::State* state = stack_.back().get();
XBT_DEBUG("**************************************************");
- XBT_DEBUG("Exploration depth=%zi (state=%p, num %d)(%zu interleave)",
- stack_.size(), state, state->num, state->interleaveSize());
+ XBT_DEBUG("Exploration depth=%zu (state=%p, num %d)(%zu interleave)", stack_.size(), state, state->num,
+ state->interleaveSize());
mc_model_checker->visited_states++;
// req is now the transition of the process that was selected to be executed
if (req == nullptr) {
- XBT_DEBUG("There are no more processes to interleave. (depth %zi)", stack_.size() + 1);
+ XBT_DEBUG("There are no more processes to interleave. (depth %zu)", stack_.size() + 1);
this->backtrack();
continue;
if (visitedState_ == nullptr) {
/* Get an enabled process and insert it in the interleave set of the next state */
- for (auto& actor : mc_model_checker->process().actors())
- if (simgrid::mc::actor_is_enabled(actor.copy.getBuffer())) {
- next_state->interleave(actor.copy.getBuffer());
+ for (auto& remoteActor : mc_model_checker->process().actors()) {
+ auto actor = remoteActor.copy.getBuffer();
+ if (simgrid::mc::actor_is_enabled(actor)) {
+ next_state->addInterleavingSet(actor);
if (reductionMode_ == simgrid::mc::ReductionMode::dpor)
- break;
+ break; // With DPOR, we take the first enabled transition
}
+ }
if (dot_output != nullptr)
std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n",
}
if (not prev_state->actorStates[issuer->pid].isDone())
- prev_state->interleave(issuer);
+ prev_state->addInterleavingSet(issuer);
else
XBT_DEBUG("Process %p is in done set", req->issuer);
if (state->interleaveSize()
&& stack_.size() < (std::size_t) _sg_mc_max_depth) {
/* We found a back-tracking point, let's loop */
- XBT_DEBUG("Back-tracking to state %d at depth %zi", state->num, stack_.size() + 1);
+ XBT_DEBUG("Back-tracking to state %d at depth %zu", state->num, stack_.size() + 1);
stack_.push_back(std::move(state));
this->restoreState();
- XBT_DEBUG("Back-tracking to state %d at depth %zi done",
- stack_.back()->num, stack_.size());
+ XBT_DEBUG("Back-tracking to state %d at depth %zu done", stack_.back()->num, stack_.size());
break;
} else {
- XBT_DEBUG("Delete state %d at depth %zi",
- state->num, stack_.size() + 1);
+ XBT_DEBUG("Delete state %d at depth %zu", state->num, stack_.size() + 1);
}
}
}
/* Get an enabled actor and insert it in the interleave set of the initial state */
for (auto& actor : mc_model_checker->process().actors())
if (simgrid::mc::actor_is_enabled(actor.copy.getBuffer())) {
- initial_state->interleave(actor.copy.getBuffer());
+ initial_state->addInterleavingSet(actor.copy.getBuffer());
if (reductionMode_ != simgrid::mc::ReductionMode::none)
break;
}
{
return new SafetyChecker(session);
}
-
+
}
}