- // Backtrack if the interleave set is empty or the maximum depth is reached,
- smx_simcall_t req = nullptr;
- if (stack_.size() > (std::size_t) _sg_mc_max_depth
- || (req = MC_state_get_request(state)) == nullptr
- || visitedState_ != nullptr) {
+ // Backtrack if we reached the maximum depth
+ if (stack_.size() > (std::size_t)_sg_mc_max_depth) {
+ XBT_WARN("/!\\ Max depth reached ! /!\\ ");
+ int res = this->backtrack();
+ if (res)
+ return res;
+ else
+ continue;
+ }
+
+ // Backtrack if we are revisiting a state we saw previously
+ if (visitedState_ != nullptr) {
+ XBT_DEBUG("State already visited (equal to state %d), exploration stopped on this path.",
+ visitedState_->other_num == -1 ? visitedState_->num : visitedState_->other_num);
+
+ visitedState_ = nullptr;
+ int res = this->backtrack();
+ if (res)
+ return res;
+ else
+ continue;
+ }
+
+ smx_simcall_t req = MC_state_get_request(state);
+ // Backtrack if the interleave set is empty
+ if (req == nullptr) {
+ XBT_DEBUG("There are no more processes to interleave. (depth %zi)", stack_.size() + 1);
+