Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
9d3deb383694c3616de211c99f2571baf09d7f64
[simgrid.git] / src / include / mc / mc.h
1 /* Copyright (c) 2008-2015. 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 <src/internal_config.h>
11 #include <simgrid/simix.h>
12 #include <simgrid/modelchecker.h> /* our public interface (and definition of HAVE_MC) */
13 #if HAVE_UCONTEXT_H
14 #include <ucontext.h>           /* context relative declarations */
15 #endif
16
17 /* Maximum size of the application heap.
18  *
19  * The model-checker heap is placed at this offset from the beginning of the application heap.
20  *
21  * In the current implementation, if the application uses more than this for the application heap the application heap
22  * will smash the beginning of the model-checker heap and bad things will happen.
23  *
24  * For 64 bits systems, we have a lot of virtual memory available so we wan use a much bigger value in order to avoid
25  * bad things from happening.
26  * */
27
28 #define STD_HEAP_SIZE   (sizeof(void*)<=4 ? (100*1024*1024) : (1ll*1024*1024*1024*1024))
29
30 SG_BEGIN_DECL()
31
32 /********************************** Configuration of MC **************************************/  
33 extern XBT_PUBLIC(int) _sg_do_model_check;
34 extern XBT_PRIVATE int _sg_do_model_check_record;
35 extern XBT_PRIVATE int _sg_mc_checkpoint;
36 extern XBT_PUBLIC(int) _sg_mc_sparse_checkpoint;
37 extern XBT_PUBLIC(int) _sg_mc_ksm;
38 extern XBT_PUBLIC(char*) _sg_mc_property_file;
39 extern XBT_PRIVATE int _sg_mc_timeout;
40 extern XBT_PRIVATE int _sg_mc_hash;
41 extern XBT_PRIVATE int _sg_mc_max_depth;
42 extern XBT_PUBLIC(int) _sg_mc_visited;
43 extern XBT_PRIVATE char* _sg_mc_dot_output_file;
44 extern XBT_PUBLIC(int) _sg_mc_comms_determinism;
45 extern XBT_PUBLIC(int) _sg_mc_send_determinism;
46 extern XBT_PRIVATE int _sg_mc_snapshot_fds;
47 extern XBT_PRIVATE int _sg_mc_termination;
48
49 /********************************* Global *************************************/
50 XBT_PRIVATE void _mc_cfg_cb_reduce(const char *name);
51 XBT_PRIVATE void _mc_cfg_cb_checkpoint(const char *name);
52 XBT_PRIVATE void _mc_cfg_cb_sparse_checkpoint(const char *name);
53 XBT_PRIVATE void _mc_cfg_cb_ksm(const char *name);
54 XBT_PRIVATE void _mc_cfg_cb_property(const char *name);
55 XBT_PRIVATE void _mc_cfg_cb_timeout(const char *name);
56 XBT_PRIVATE void _mc_cfg_cb_snapshot_fds(const char *name);
57 XBT_PRIVATE void _mc_cfg_cb_hash(const char *name);
58 XBT_PRIVATE void _mc_cfg_cb_max_depth(const char *name);
59 XBT_PRIVATE void _mc_cfg_cb_visited(const char *name);
60 XBT_PRIVATE void _mc_cfg_cb_dot_output(const char *name);
61 XBT_PRIVATE void _mc_cfg_cb_comms_determinism(const char *name);
62 XBT_PRIVATE void _mc_cfg_cb_send_determinism(const char *name);
63 XBT_PRIVATE void _mc_cfg_cb_termination(const char *name);
64
65 XBT_PUBLIC(void) MC_run(void);
66 XBT_PUBLIC(void) MC_process_clock_add(smx_process_t, double);
67 XBT_PUBLIC(double) MC_process_clock_get(smx_process_t);
68 XBT_PRIVATE void MC_automaton_load(const char *file);
69
70 /****************************** MC ignore **********************************/
71 XBT_PUBLIC(void) MC_ignore_heap(void *address, size_t size);
72 XBT_PUBLIC(void) MC_remove_ignore_heap(void *address, size_t size);
73 XBT_PUBLIC(void) MC_ignore_local_variable(const char *var_name, const char *frame);
74 XBT_PUBLIC(void) MC_ignore_global_variable(const char *var_name);
75 #if HAVE_UCONTEXT_H
76 XBT_PUBLIC(void) MC_register_stack_area(void *stack, smx_process_t process, ucontext_t* context, size_t size);
77 #endif
78
79 /********************************* Memory *************************************/
80 XBT_PUBLIC(void) MC_memory_init(void);  /* Initialize the memory subsystem */
81 XBT_PUBLIC(void) MC_memory_exit(void);
82 XBT_PUBLIC(void) MC_memory_init_server(void);
83
84 SG_END_DECL()
85
86 #endif                          /* _MC_MC_H */