X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/45060ff9a849119da4e39431e30c2e8c763cca4e..2b1c48aa8ff28c0d706779f2a69aadc5333e48ab:/src/mc/mc_private.h diff --git a/src/mc/mc_private.h b/src/mc/mc_private.h index eb0f614bd1..9b36857fca 100644 --- a/src/mc/mc_private.h +++ b/src/mc/mc_private.h @@ -19,7 +19,6 @@ #include "xbt/hash.h" #include "msg/msg.h" #include "msg/datatypes.h" -#include "simix/datatypes.h" /****************************** Snapshots ***********************************/ @@ -39,10 +38,10 @@ extern char *prog_name; void MC_take_snapshot(mc_snapshot_t); void MC_take_snapshot_liveness(mc_snapshot_t s); -void MC_take_snapshot_to_restore_liveness(mc_snapshot_t s); void MC_restore_snapshot(mc_snapshot_t); void MC_free_snapshot(mc_snapshot_t); + /********************************* MC Global **********************************/ extern double *mc_time; @@ -51,16 +50,13 @@ extern double *mc_time; #define MAX_DEPTH_LIVENESS 500 int MC_deadlock_check(void); -void MC_replay(xbt_fifo_t stack); +void MC_replay(xbt_fifo_t stack, int start); void MC_replay_liveness(xbt_fifo_t stack, int all_stack); void MC_wait_for_requests(void); void MC_get_enabled_processes(); void MC_show_deadlock(smx_simcall_t req); -void MC_show_deadlock_stateful(smx_simcall_t req); -void MC_show_stack_safety_stateless(xbt_fifo_t stack); -void MC_dump_stack_safety_stateless(xbt_fifo_t stack); -void MC_show_stack_safety_stateful(xbt_fifo_t stack); -void MC_dump_stack_safety_stateful(xbt_fifo_t stack); +void MC_show_stack_safety(xbt_fifo_t stack); +void MC_dump_stack_safety(xbt_fifo_t stack); /********************************* Requests ***********************************/ int MC_request_depend(smx_simcall_t req1, smx_simcall_t req2); @@ -97,6 +93,7 @@ typedef struct mc_state { s_smx_simcall_t executed_req; /* The executed request of the state */ int req_num; /* The request number (in the case of a multi-request like waitany ) */ + mc_snapshot_t system_state; /* Snapshot of system state */ } s_mc_state_t, *mc_state_t; extern xbt_fifo_t mc_stack_safety_stateless; @@ -139,8 +136,7 @@ void MC_print_statistics_pairs(mc_stats_pair_t); extern void *std_heap; extern void *raw_heap; -/* extern int raw_heap_fd; */ /* unused */ -#define STD_HEAP_SIZE 20480000 /* Maximum size of the system's heap */ + /* FIXME: Horrible hack! because the mmalloc library doesn't provide yet of */ /* an API to query about the status of a heap, we simply call mmstats and */ @@ -155,7 +151,9 @@ struct mstats { }; #define MC_SET_RAW_MEM mmalloc_set_current_heap(raw_heap) -#define MC_UNSET_RAW_MEM mmalloc_set_current_heap(std_heap) +#define MC_UNSET_RAW_MEM mmalloc_set_current_heap(std_heap) + +extern int raw_mem_set; /******************************* MEMORY MAPPINGS ***************************/ /* These functions and data structures implements a binary interface for */ @@ -186,32 +184,24 @@ typedef struct s_memory_map { memory_map_t get_memory_map(void); -/********************************** DPOR for safety (stateless) **************************************/ +/********************************** DPOR for safety **************************************/ +typedef enum { + e_mc_reduce_unset, + e_mc_reduce_none, + e_mc_reduce_dpor +} e_mc_reduce_t; +extern e_mc_reduce_t mc_reduce_kind; + void MC_dpor_init(void); void MC_dpor(void); void MC_dpor_exit(void); - -/***** DPOR for safety (stateful) **** */ - -typedef struct s_mc_state_with_snapshot{ - mc_snapshot_t system_state; - mc_state_t graph_state; -}s_mc_state_ws_t, *mc_state_ws_t; - -extern xbt_fifo_t mc_stack_safety_stateful; - -void MC_init_stateful(void); -void MC_modelcheck_stateful(void); -mc_state_ws_t new_state_ws(mc_snapshot_t s, mc_state_t gs); -void MC_dpor_stateful_init(void); -void MC_dpor_stateful(void); -void MC_exit_stateful(void); +void MC_init_safety(void); /********************************** Double-DFS for liveness property**************************************/ extern mc_snapshot_t initial_snapshot_liveness; -extern xbt_automaton_t automaton; +extern xbt_automaton_t _mc_property_automaton; typedef struct s_mc_pair{ mc_snapshot_t system_state; @@ -220,6 +210,7 @@ typedef struct s_mc_pair{ }s_mc_pair_t, *mc_pair_t; typedef struct s_mc_pair_reached{ + int nb; xbt_state_t automaton_state; xbt_dynar_t prop_ato; mc_snapshot_t system_state; @@ -266,7 +257,6 @@ void set_pair_visited_hash(xbt_state_t st, int search_cycle); unsigned int hash_region(char *str, int str_len); int rdv_points_compare(xbt_dict_t d1, xbt_dict_t d2); - /* **** Double-DFS stateless **** */ typedef struct s_mc_pair_stateless{ @@ -284,5 +274,15 @@ void MC_show_stack_liveness(xbt_fifo_t stack); void MC_dump_stack_liveness(xbt_fifo_t stack); void MC_pair_stateless_delete(mc_pair_stateless_t pair); +/********************************** Configuration of MC **************************************/ +extern xbt_fifo_t mc_stack_safety; + +extern int _surf_mc_checkpoint; +extern char* _surf_mc_property_file; + +/****** Core dump ******/ + +int create_dump(int pair); + #endif