X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/740d50812a81c59013f22888ab313da5a8113227..3cf8dfbfab4595b3e7ae85d3cd89ce9dbcdd7a24:/src/mc/mc_safety.cpp diff --git a/src/mc/mc_safety.cpp b/src/mc/mc_safety.cpp index 594cb71a0a..4047f13f41 100644 --- a/src/mc/mc_safety.cpp +++ b/src/mc/mc_safety.cpp @@ -64,14 +64,12 @@ static void MC_pre_modelcheck_safety() mc_model_checker->wait_for_requests(); /* Get an enabled process and insert it in the interleave set of the initial state */ - smx_process_t process; - MC_EACH_SIMIX_PROCESS(process, - if (MC_process_is_enabled(process)) { - MC_state_interleave_process(initial_state, process); + for (auto& p : mc_model_checker->process().simix_processes()) + if (MC_process_is_enabled(&p.copy)) { + MC_state_interleave_process(initial_state, &p.copy); if (mc_reduce_kind != e_mc_reduce_none) break; } - ); xbt_fifo_unshift(mc_stack, initial_state); } @@ -114,9 +112,8 @@ int MC_modelcheck_safety(void) XBT_DEBUG("Execute: %s", req_str); xbt_free(req_str); - if (dot_output != nullptr) { + if (dot_output != nullptr) req_str = MC_request_get_dot_output(req, value); - } MC_state_set_executed_request(state, req, value); mc_stats->executed_transitions++; @@ -139,24 +136,19 @@ int MC_modelcheck_safety(void) if ((visited_state = is_visited_state(next_state)) == nullptr) { /* Get an enabled process and insert it in the interleave set of the next state */ - smx_process_t process = nullptr; - MC_EACH_SIMIX_PROCESS(process, - if (MC_process_is_enabled(process)) { - MC_state_interleave_process(next_state, process); + for (auto& p : mc_model_checker->process().simix_processes()) + if (MC_process_is_enabled(&p.copy)) { + MC_state_interleave_process(next_state, &p.copy); if (mc_reduce_kind != e_mc_reduce_none) break; } - ); if (dot_output != nullptr) std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num, next_state->num, req_str); - } else { - - if (dot_output != nullptr) - std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num, visited_state->other_num == -1 ? visited_state->num : visited_state->other_num, req_str); + } else if (dot_output != nullptr) + std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num, visited_state->other_num == -1 ? visited_state->num : visited_state->other_num, req_str); - } xbt_fifo_unshift(mc_stack, next_state); @@ -177,12 +169,9 @@ int MC_modelcheck_safety(void) else XBT_DEBUG("State already visited (equal to state %d), exploration stopped on this path.", visited_state->other_num == -1 ? visited_state->num : visited_state->other_num); - } else { - + } else XBT_DEBUG("There are no more processes to interleave. (depth %d)", xbt_fifo_size(mc_stack) + 1); - } - /* Trash the current state, no longer needed */ xbt_fifo_shift(mc_stack); XBT_DEBUG("Delete state %d at depth %d", state->num, xbt_fifo_size(mc_stack) + 1);