-void CommunicationDeterminismChecker::real_run()
-{
- std::unique_ptr<VisitedState> visited_state = nullptr;
- smx_simcall_t req = 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();
-
- if (stack_.size() <= (std::size_t)_sg_mc_max_depth)
- req = api::get().mc_state_choose_request(cur_state);
- else
- req = nullptr;
-
- if (req != nullptr && visited_state == nullptr) {
- int req_num = cur_state->transition_.times_considered_;
-
- XBT_DEBUG("Execute: %s", api::get().request_to_string(req, req_num).c_str());
-
- std::string req_str;
- if (dot_output != nullptr)
- req_str = api::get().request_get_dot_output(req, req_num);
-
- api::get().mc_inc_executed_trans();
-
- /* 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);
-
- /* Answer the request */
- api::get().handle_simcall(cur_state->transition_);
- /* After this call req is no longer useful */
-
- handle_comm_pattern(call, req, req_num, 0);
-
- /* Wait for requests (schedules processes) */
- api::get().mc_wait_for_requests();
-
- /* 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);