X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/77385a2b4bc1518d701cbf33acc04d16ae3b640b..d0d7c4f8a7587bb46decfba7246deceafadbaf5d:/src/mc/explo/LivenessChecker.cpp diff --git a/src/mc/explo/LivenessChecker.cpp b/src/mc/explo/LivenessChecker.cpp index 8730db9e79..7466bce11c 100644 --- a/src/mc/explo/LivenessChecker.cpp +++ b/src/mc/explo/LivenessChecker.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2011-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -62,7 +62,10 @@ std::shared_ptr LivenessChecker::insert_acceptance_pair(simgrid::mc auto new_pair = std::make_shared(pair->num, pair->prop_state_, pair->atomic_propositions, pair->app_state_); - auto [res_begin, res_end] = boost::range::equal_range(acceptance_pairs_, new_pair.get(), Api::get().compare_pair()); + auto [res_begin, + res_end] = boost::range::equal_range(acceptance_pairs_, new_pair.get(), [](auto const& a, auto const& b) { + return std::make_pair(a->actor_count_, a->heap_bytes_used) < std::make_pair(b->actor_count_, b->heap_bytes_used); + }); if (pair->search_cycle) for (auto i = res_begin; i != res_end; ++i) { @@ -138,8 +141,10 @@ int LivenessChecker::insert_visited_pair(std::shared_ptr visited_pa visited_pair = std::make_shared(pair->num, pair->prop_state_, pair->atomic_propositions, pair->app_state_); - auto [range_begin, range_end] = - boost::range::equal_range(visited_pairs_, visited_pair.get(), Api::get().compare_pair()); + auto [range_begin, + range_end] = boost::range::equal_range(visited_pairs_, visited_pair.get(), [](auto const& a, auto const& b) { + return std::make_pair(a->actor_count_, a->heap_bytes_used) < std::make_pair(b->actor_count_, b->heap_bytes_used); + }); for (auto i = range_begin; i != range_end; ++i) { const VisitedPair* pair_test = i->get(); @@ -175,13 +180,12 @@ void LivenessChecker::purge_visited_pairs() LivenessChecker::LivenessChecker(const std::vector& args) : Exploration(args) {} LivenessChecker::~LivenessChecker() { - if (property_automaton_ != nullptr) - xbt_automaton_free(property_automaton_); + xbt_automaton_free(property_automaton_); } xbt_automaton_t LivenessChecker::property_automaton_ = nullptr; -void LivenessChecker::automaton_load(const char* file) +void LivenessChecker::automaton_load(const char* file) const { if (property_automaton_ == nullptr) property_automaton_ = xbt_automaton_new(); @@ -237,7 +241,8 @@ xbt_automaton_state_t LivenessChecker::get_automaton_transition_dst(xbt_dynar_t const xbt_automaton_transition* transition = xbt_dynar_get_as(dynar, index, xbt_automaton_transition_t); return transition->dst; } -void LivenessChecker::automaton_register_symbol(RemoteProcess& remote_process, const char* name, RemotePtr address) +void LivenessChecker::automaton_register_symbol(RemoteProcess const& remote_process, const char* name, + RemotePtr address) { if (property_automaton_ == nullptr) property_automaton_ = xbt_automaton_new(); @@ -270,7 +275,9 @@ void LivenessChecker::show_acceptance_cycle(std::size_t depth) XBT_INFO("Counter-example that violates formula:"); for (auto const& s : this->get_textual_trace()) XBT_INFO(" %s", s.c_str()); - XBT_INFO("Path = %s", get_record_trace().to_string().c_str()); + XBT_INFO("You can debug the problem (and see the whole details) by rerunning out of simgrid-mc with " + "--cfg=model-check/replay:'%s'", + get_record_trace().to_string().c_str()); log_state(); XBT_INFO("Counter-example depth: %zu", depth); }