Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
80f71466b050257f664bf6ccc9d2e91aa611763a
[simgrid.git] / src / include / mc / mc.h
1 /* Copyright (c) 2008-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef _MC_MC_H
8 #define _MC_MC_H
9
10 #include "xbt/misc.h"
11 #include "xbt/fifo.h"
12 #include "xbt/dict.h"
13 #include "xbt/function_types.h"
14 #include "mc/datatypes.h"
15 #include "simgrid/simix.h"
16 #include "simgrid/modelchecker.h" /* our public interface (and definition of HAVE_MC) */
17 #include "xbt/automaton.h"
18 #include "xbt/dynar.h"
19
20 /* Maximum size of the application heap.
21  *
22  * The model-checker heap is placed at this offset from the
23  * beginning of the application heap.
24  *
25  * In the current implementation, if the application uses more
26  * than this for the application heap the application heap will
27  * smash the beginning of the model-checker heap and bad things
28  * will happen.
29  *
30  * For 64 bits systems, we have a lot of virtual memory available
31  * so we wan use a much bigger value in order to avoid bad things
32  * from happening.
33  * */
34
35 #define STD_HEAP_SIZE   (sizeof(void*)<=4 ? (100*1024*1024) : (1ll*1024*1024*1024*1024))
36
37 SG_BEGIN_DECL()
38
39 /********************************** Configuration of MC **************************************/ 
40 extern int _sg_do_model_check;
41 extern int _sg_mc_checkpoint;
42 extern char* _sg_mc_property_file;
43 extern int _sg_mc_timeout;
44 extern int _sg_mc_hash;
45 extern int _sg_mc_max_depth;
46 extern int _sg_mc_visited;
47 extern char* _sg_mc_dot_output_file;
48 extern int _sg_mc_comms_determinism;
49 extern int _sg_mc_send_determinism;
50
51 extern xbt_dynar_t mc_heap_comparison_ignore;
52 extern xbt_dynar_t stacks_areas;
53 extern void *maestro_stack_start;
54 extern void *maestro_stack_end;
55
56 /********************************* Global *************************************/
57 void _mc_cfg_cb_reduce(const char *name, int pos);
58 void _mc_cfg_cb_checkpoint(const char *name, int pos);
59 void _mc_cfg_cb_property(const char *name, int pos);
60 void _mc_cfg_cb_timeout(const char *name, int pos);
61 void _mc_cfg_cb_hash(const char *name, int pos);
62 void _mc_cfg_cb_max_depth(const char *name, int pos);
63 void _mc_cfg_cb_visited(const char *name, int pos);
64 void _mc_cfg_cb_dot_output(const char *name, int pos);
65 void _mc_cfg_cb_comms_determinism(const char *name, int pos);
66 void _mc_cfg_cb_send_determinism(const char *name, int pos);
67
68 XBT_PUBLIC(void) MC_do_the_modelcheck_for_real(void);
69
70 XBT_PUBLIC(void) MC_init(void);
71 XBT_PUBLIC(void) MC_exit(void);
72 XBT_PUBLIC(void) MC_modelcheck_safety(void);
73 XBT_PUBLIC(void) MC_modelcheck_liveness(void);
74 XBT_PUBLIC(void) MC_process_clock_add(smx_process_t, double);
75 XBT_PUBLIC(double) MC_process_clock_get(smx_process_t);
76 void MC_automaton_load(const char *file);
77
78 /****************************** MC ignore **********************************/
79 XBT_PUBLIC(void) MC_ignore_heap(void *address, size_t size);
80 XBT_PUBLIC(void) MC_remove_ignore_heap(void *address, size_t size);
81 XBT_PUBLIC(void) MC_ignore_local_variable(const char *var_name, const char *frame);
82 XBT_PUBLIC(void) MC_ignore_global_variable(const char *var_name);
83 void MC_new_stack_area(void *stack, char *name, void *context, size_t size);
84
85 /********************************* Memory *************************************/
86 XBT_PUBLIC(void) MC_memory_init(void);  /* Initialize the memory subsystem */
87 XBT_PUBLIC(void) MC_memory_exit(void);
88
89 SG_END_DECL()
90
91 #endif                          /* _MC_MC_H */