Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : application alert for state equality detection
[simgrid.git] / src / mc / mc_private.h
index 89ff690..0de5a9e 100644 (file)
@@ -6,6 +6,7 @@
 #ifndef MC_PRIVATE_H
 #define MC_PRIVATE_H
 
+#include "simgrid_config.h"
 #include <stdio.h>
 #include <sys/mman.h>
 #include "mc/mc.h"
@@ -19,7 +20,6 @@
 #include "xbt/hash.h"
 #include "msg/msg.h"
 #include "msg/datatypes.h"
-#include "simix/datatypes.h"
 
 /****************************** Snapshots ***********************************/
 
@@ -39,10 +39,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 +51,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 +94,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 +137,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 +152,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   */
@@ -174,11 +173,11 @@ typedef struct s_map_region {
   unsigned long inode;          /* Inode in the device */
   char *pathname;               /* Path name of the mapped file */
 
-} s_map_region;
+} s_map_region_t;
 
 typedef struct s_memory_map {
 
-  s_map_region *regions;        /* Pointer to an array of regions */
+  s_map_region_t *regions;      /* Pointer to an array of regions */
   int mapsize;                  /* Number of regions in the memory */
 
 } s_memory_map_t, *memory_map_t;
@@ -186,32 +185,25 @@ 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;
+extern int compare;
 
 typedef struct s_mc_pair{
   mc_snapshot_t system_state;
@@ -220,6 +212,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;
@@ -264,8 +257,6 @@ void set_pair_visited(xbt_state_t st, int search_cycle);
 int visited_hash(xbt_state_t st, int search_cycle);
 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 **** */
 
@@ -284,5 +275,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