X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b487d5a9259b88670b8cd97e9c16e4b000c11008..2376a01092173679830310f4d57b267445959f97:/src/mc/mc_safety.h diff --git a/src/mc/mc_safety.h b/src/mc/mc_safety.h index b8aa3b4a05..60c177f1f9 100644 --- a/src/mc/mc_safety.h +++ b/src/mc/mc_safety.h @@ -1,45 +1,51 @@ -/* Copyright (c) 2007-2014. The SimGrid Team. +/* Copyright (c) 2007-2015. 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. */ -#ifndef MC_SAFETY_H -#define MC_SAFETY_H +#ifndef SIMGRID_MC_SAFETY_H +#define SIMGRID_MC_SAFETY_H #include +#include +#include + #include -#include -#include "mc_interface.h" -SG_BEGIN_DECL() +#include +#include + +#include "src/mc/mc_forward.hpp" +#include "src/mc/mc_state.h" + +namespace simgrid { +namespace mc { -typedef enum { - e_mc_reduce_unset, - e_mc_reduce_none, - e_mc_reduce_dpor -} e_mc_reduce_t; +enum class ReductionMode { + unset, + none, + dpor, +}; -extern e_mc_reduce_t mc_reduce_kind; -extern xbt_dict_t first_enabled_state; +extern XBT_PRIVATE simgrid::mc::ReductionMode reduction_mode; -void MC_pre_modelcheck_safety(void); -void MC_modelcheck_safety(void); +struct XBT_PRIVATE VisitedState { + std::shared_ptr system_state = nullptr; + size_t heap_bytes_used = 0; + int nb_processes = 0; + int num = 0; + int other_num = 0; // dot_output for -typedef struct s_mc_visited_state{ - mc_snapshot_t system_state; - size_t heap_bytes_used; - int nb_processes; - int num; - int other_num; // dot_output for -}s_mc_visited_state_t, *mc_visited_state_t; + VisitedState(); + ~VisitedState(); +}; -extern xbt_dynar_t visited_states; -mc_visited_state_t is_visited_state(void); -void visited_state_free(mc_visited_state_t state); -void visited_state_free_voidp(void *s); +extern XBT_PRIVATE std::vector> visited_states; +XBT_PRIVATE std::unique_ptr is_visited_state(simgrid::mc::State* graph_state, bool compare_snpashots); -SG_END_DECL() +} +} #endif