Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't define variables in header files (part 2).
[simgrid.git] / src / mc / mc_private.h
index 09e8932..9b36857 100644 (file)
@@ -41,6 +41,7 @@ void MC_take_snapshot_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;
 
@@ -49,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);
@@ -95,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;
@@ -137,7 +136,7 @@ void MC_print_statistics_pairs(mc_stats_pair_t);
 
 extern void *std_heap;
 extern void *raw_heap;
-#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 */
@@ -152,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   */
@@ -183,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;
@@ -217,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;
@@ -253,8 +247,6 @@ void set_pair_reached(xbt_state_t st);
 int reached_hash(xbt_state_t st);
 void set_pair_reached_hash(xbt_state_t st);
 int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2);
-int data_program_region_compare(void *d1, void *d2, size_t size);
-int data_libsimgrid_region_compare(void *d1, void *d2, size_t size);
 void MC_pair_delete(mc_pair_t pair);
 void MC_exit_liveness(void);
 mc_state_t MC_state_pair_new(void);
@@ -265,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{
@@ -283,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