Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix #includes to automaton.h
[simgrid.git] / src / mc / mc_private.h
1 /* Copyright (c) 2007-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 SIMGRID_MC_PRIVATE_H
8 #define SIMGRID_MC_PRIVATE_H
9
10 #include "simgrid_config.h"
11
12 #include <sys/types.h>
13
14 #include <stdio.h>
15 #ifndef WIN32
16 #include <sys/mman.h>
17 #endif
18
19 #include <elfutils/libdw.h>
20
21 #include <simgrid/msg.h>
22 #include <xbt/fifo.h>
23 #include <xbt/config.h>
24 #include <xbt/base.h>
25 #include <xbt/automaton.h>
26
27 #include "mc/mc.h"
28 #include "mc/datatypes.h"
29 #include "src/mc/mc_base.h"
30
31 #include "src/simix/smx_private.h"
32 #include "src/xbt/mmalloc/mmprivate.h"
33
34 #ifdef __cplusplus
35 #include "src/mc/mc_forward.hpp"
36 #include "src/xbt/memory_map.hpp"
37 #endif
38
39 #include "src/mc/mc_protocol.h"
40
41 #ifdef __cplusplus
42 namespace simgrid {
43 namespace mc {
44
45 struct DerefAndCompareByNbProcessesAndUsedHeap {
46   template<class X, class Y>
47   bool operator()(X const& a, Y const& b)
48   {
49     return std::make_pair(a->nb_processes, a->heap_bytes_used) <
50       std::make_pair(b->nb_processes, b->heap_bytes_used);
51   }
52 };
53
54 }
55 }
56 #endif
57
58 SG_BEGIN_DECL()
59
60 /********************************* MC Global **********************************/
61
62 XBT_PRIVATE void MC_init_dot_output();
63
64 XBT_PRIVATE extern FILE *dot_output;
65
66 XBT_PRIVATE extern int user_max_depth_reached;
67
68 XBT_PRIVATE void MC_replay(xbt_fifo_t stack);
69 XBT_PRIVATE void MC_show_deadlock(void);
70
71 /** Stack (of `simgrid::mc::State*`) representing the current position of the
72  *  the MC in the exploration graph
73  *
74  *  It is managed by its head (`xbt_fifo_shift` and `xbt_fifo_unshift`).
75  */
76 XBT_PRIVATE extern xbt_fifo_t mc_stack;
77
78 /****************************** Statistics ************************************/
79
80 typedef struct mc_stats {
81   unsigned long state_size;
82   unsigned long visited_states;
83   unsigned long visited_pairs;
84   unsigned long expanded_states;
85   unsigned long expanded_pairs;
86   unsigned long executed_transitions;
87 } s_mc_stats_t, *mc_stats_t;
88
89 XBT_PRIVATE extern mc_stats_t mc_stats;
90
91 XBT_PRIVATE void MC_print_statistics(mc_stats_t stats);
92
93 /********************************** Snapshot comparison **********************************/
94
95 //#define MC_DEBUG 1
96 #define MC_VERBOSE 1
97
98 /********************************** Miscellaneous **********************************/
99
100 XBT_PRIVATE void MC_report_assertion_error(void);
101 XBT_PRIVATE void MC_report_crash(int status);
102
103 SG_END_DECL()
104
105 #ifdef __cplusplus
106
107 namespace simgrid {
108 namespace mc {
109
110 XBT_PRIVATE void find_object_address(
111   std::vector<simgrid::xbt::VmMap> const& maps, simgrid::mc::ObjectInformation* result);
112
113 XBT_PRIVATE
114 int snapshot_compare(int num1, simgrid::mc::Snapshot* s1, int num2, simgrid::mc::Snapshot* s2);
115
116 // Move is somewhere else (in the LivenessChecker class, in the Session class?):
117 extern XBT_PRIVATE xbt_automaton_t property_automaton;
118
119 }
120 }
121
122 #endif
123
124 #endif