-void CommunicationDeterminismChecker::real_run()
-{
- std::unique_ptr<VisitedState> visited_state = nullptr;
-
- while (not stack_.empty()) {
- /* Get current state */
- State* cur_state = stack_.back().get();
-
- XBT_DEBUG("**************************************************");
- XBT_DEBUG("Exploration depth = %zu (state = %d, interleaved processes = %zu)", stack_.size(), cur_state->num_,
- cur_state->count_todo());
-
- /* Update statistics */
- api::get().mc_inc_visited_states();
-
- int next_transition = -1;
- if (stack_.size() <= (std::size_t)_sg_mc_max_depth)
- next_transition = cur_state->next_transition();
-
- if (next_transition >= 0 && visited_state == nullptr) {
- cur_state->execute_next(next_transition);
-
- aid_t aid = cur_state->get_transition()->aid_;
- int req_num = cur_state->get_transition()->times_considered_;
- smx_simcall_t req = &cur_state->executed_req_;
-
- XBT_DEBUG("Execute: %s", cur_state->get_transition()->to_cstring());
-
- std::string req_str;
- if (dot_output != nullptr)
- req_str = api::get().request_get_dot_output(aid, req_num);
-
- /* TODO : handle test and testany simcalls */
- CallType call = CallType::NONE;
- if (_sg_mc_comms_determinism || _sg_mc_send_determinism)
- call = MC_get_call_type(req);
-
- handle_comm_pattern(call, req, req_num, 0);
-
- /* Create the new expanded state */
- ++expanded_states_count_;
- auto next_state = std::make_unique<State>(expanded_states_count_);
-
- /* If comm determinism verification, we cannot stop the exploration if some communications are not finished (at
- * least, data are transferred). These communications are incomplete and they cannot be analyzed and compared
- * with the initial pattern. */
- bool compare_snapshots = this->initial_communications_pattern_done && all_communications_are_finished();
-
- if (_sg_mc_max_visited_states != 0)
- visited_state = visited_states_.addVisitedState(expanded_states_count_, next_state.get(), compare_snapshots);
- else
- visited_state = nullptr;
-
- if (visited_state == nullptr) {
- /* Add all enabled actors to the interleave set of the next state */
- for (auto& act : api::get().get_actors()) {
- auto actor = act.copy.get_buffer();
- if (get_session().actor_is_enabled(actor->get_pid()))
- next_state->mark_todo(actor->get_pid());