X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5e7ea743f4e41c8fb6e0c1cce87df1ff8804a82a..30d60b272963b1b130ea80840af783ee9c146b97:/src/mc/mc_comm_determinism.cpp?ds=sidebyside diff --git a/src/mc/mc_comm_determinism.cpp b/src/mc/mc_comm_determinism.cpp index 623365919e..f1119d2330 100644 --- a/src/mc/mc_comm_determinism.cpp +++ b/src/mc/mc_comm_determinism.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -304,7 +305,7 @@ static void MC_pre_modelcheck_comm_determinism(void) const int maxpid = MC_smx_get_maxpid(); if (_sg_mc_visited > 0) - visited_states = xbt_dynar_new(sizeof(mc_visited_state_t), visited_state_free_voidp); + simgrid::mc::visited_states = simgrid::xbt::newDeleteDynar(); // Create initial_communications_pattern elements: initial_communications_pattern = xbt_dynar_new(sizeof(mc_list_comm_pattern_t), MC_list_comm_pattern_free_voidp); @@ -331,7 +332,7 @@ static void MC_pre_modelcheck_comm_determinism(void) /* Get an enabled process and insert it in the interleave set of the initial state */ for (auto& p : mc_model_checker->process().simix_processes()) - if (MC_process_is_enabled(&p.copy)) + if (simgrid::mc::process_is_enabled(&p.copy)) MC_state_interleave_process(initial_state, &p.copy); xbt_fifo_unshift(mc_stack, initial_state); @@ -342,7 +343,7 @@ static int MC_modelcheck_comm_determinism_main(void) char *req_str = nullptr; int value; - mc_visited_state_t visited_state = nullptr; + simgrid::mc::VisitedState* visited_state = nullptr; smx_simcall_t req = nullptr; mc_state_t state = nullptr, next_state = NULL; @@ -363,12 +364,12 @@ static int MC_modelcheck_comm_determinism_main(void) && (req = MC_state_get_request(state, &value)) && (visited_state == nullptr)) { - req_str = MC_request_to_string(req, value, MC_REQUEST_SIMIX); + req_str = simgrid::mc::request_to_string(req, value, simgrid::mc::RequestType::simix); XBT_DEBUG("Execute: %s", req_str); xbt_free(req_str); if (dot_output != nullptr) - req_str = MC_request_get_dot_output(req, value); + req_str = simgrid::mc::request_get_dot_output(req, value); MC_state_set_executed_request(state, req, value); mc_stats->executed_transitions++; @@ -379,7 +380,7 @@ static int MC_modelcheck_comm_determinism_main(void) call = MC_get_call_type(req); /* Answer the request */ - MC_simcall_handle(req, value); /* After this call req is no longer useful */ + simgrid::mc::handle_simcall(req, value); /* After this call req is no longer useful */ if(!initial_global_state->initial_communications_pattern_done) MC_handle_comm_pattern(call, req, value, initial_communications_pattern, 0); @@ -392,11 +393,11 @@ static int MC_modelcheck_comm_determinism_main(void) /* Create the new expanded state */ next_state = MC_state_new(); - if ((visited_state = is_visited_state(next_state)) == nullptr) { + if ((visited_state = simgrid::mc::is_visited_state(next_state)) == nullptr) { /* Get enabled processes and insert them in the interleave set of the next state */ for (auto& p : mc_model_checker->process().simix_processes()) - if (MC_process_is_enabled(&p.copy)) + if (simgrid::mc::process_is_enabled(&p.copy)) MC_state_interleave_process(next_state, &p.copy); if (dot_output != nullptr) @@ -462,7 +463,7 @@ static int MC_modelcheck_comm_determinism_main(void) int MC_modelcheck_comm_determinism(void) { XBT_INFO("Check communication determinism"); - mc_reduce_kind = e_mc_reduce_none; + simgrid::mc::reduction_mode = simgrid::mc::ReductionMode::none; mc_model_checker->wait_for_requests(); if (mc_mode == MC_MODE_CLIENT)