Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'mc' into mc++
[simgrid.git] / src / include / mc / mc.h
1 /* Copyright (c) 2008-2013. 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 #define STD_HEAP_SIZE   20480000        /* Maximum size of the system's heap */
21
22 SG_BEGIN_DECL()
23
24 /********************************** Configuration of MC **************************************/ 
25 extern int _sg_do_model_check;
26 extern int _sg_mc_checkpoint;
27 extern char* _sg_mc_property_file;
28 extern int _sg_mc_timeout;
29 extern int _sg_mc_hash;
30 extern int _sg_mc_max_depth;
31 extern int _sg_mc_visited;
32 extern char* _sg_mc_dot_output_file;
33 extern int _sg_mc_comms_determinism;
34 extern int _sg_mc_send_determinism;
35
36 extern xbt_dynar_t mc_heap_comparison_ignore;
37 extern xbt_dynar_t stacks_areas;
38 extern void *maestro_stack_start;
39 extern void *maestro_stack_end;
40
41 /********************************* Global *************************************/
42 void _mc_cfg_cb_reduce(const char *name, int pos);
43 void _mc_cfg_cb_checkpoint(const char *name, int pos);
44 void _mc_cfg_cb_property(const char *name, int pos);
45 void _mc_cfg_cb_timeout(const char *name, int pos);
46 void _mc_cfg_cb_hash(const char *name, int pos);
47 void _mc_cfg_cb_max_depth(const char *name, int pos);
48 void _mc_cfg_cb_visited(const char *name, int pos);
49 void _mc_cfg_cb_dot_output(const char *name, int pos);
50 void _mc_cfg_cb_comms_determinism(const char *name, int pos);
51 void _mc_cfg_cb_send_determinism(const char *name, int pos);
52
53 XBT_PUBLIC(void) MC_do_the_modelcheck_for_real(void);
54
55 XBT_PUBLIC(void) MC_init(void);
56 XBT_PUBLIC(void) MC_exit(void);
57 XBT_PUBLIC(void) MC_modelcheck_safety(void);
58 XBT_PUBLIC(void) MC_modelcheck_liveness(void);
59 XBT_PUBLIC(void) MC_process_clock_add(smx_process_t, double);
60 XBT_PUBLIC(double) MC_process_clock_get(smx_process_t);
61 void MC_automaton_load(const char *file);
62
63 /****************************** MC ignore **********************************/
64 XBT_PUBLIC(void) MC_ignore_heap(void *address, size_t size);
65 XBT_PUBLIC(void) MC_remove_ignore_heap(void *address, size_t size);
66 XBT_PUBLIC(void) MC_ignore_local_variable(const char *var_name, const char *frame);
67 XBT_PUBLIC(void) MC_ignore_global_variable(const char *var_name);
68 void MC_new_stack_area(void *stack, char *name, void *context, size_t size);
69
70 /********************************* Memory *************************************/
71 XBT_PUBLIC(void) MC_memory_init(void);  /* Initialize the memory subsystem */
72 XBT_PUBLIC(void) MC_memory_exit(void);
73
74 SG_END_DECL()
75
76 #endif                          /* _MC_MC_H */