Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Use std::vector for State::incomplete_comm_pattern (dexbtification)
[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/config.h>
23 #include <xbt/base.h>
24 #include <xbt/automaton.h>
25
26 #include "mc/mc.h"
27 #include "mc/datatypes.h"
28 #include "src/mc/mc_base.h"
29
30 #include "src/simix/smx_private.h"
31 #include "src/xbt/mmalloc/mmprivate.h"
32
33 #ifdef __cplusplus
34 #include "src/mc/mc_forward.hpp"
35 #include "src/xbt/memory_map.hpp"
36 #endif
37
38 #include "src/mc/mc_protocol.h"
39
40 #ifdef __cplusplus
41 namespace simgrid {
42 namespace mc {
43
44 struct DerefAndCompareByNbProcessesAndUsedHeap {
45   template<class X, class Y>
46   bool operator()(X const& a, Y const& b)
47   {
48     return std::make_pair(a->nb_processes, a->heap_bytes_used) <
49       std::make_pair(b->nb_processes, b->heap_bytes_used);
50   }
51 };
52
53 }
54 }
55 #endif
56
57 SG_BEGIN_DECL()
58
59 /********************************* MC Global **********************************/
60
61 XBT_PRIVATE void MC_init_dot_output();
62
63 XBT_PRIVATE extern FILE *dot_output;
64
65 XBT_PRIVATE void MC_show_deadlock(void);
66
67 /****************************** Statistics ************************************/
68
69 typedef struct mc_stats {
70   unsigned long state_size;
71   unsigned long visited_states;
72   unsigned long visited_pairs;
73   unsigned long expanded_states;
74   unsigned long expanded_pairs;
75   unsigned long executed_transitions;
76 } s_mc_stats_t, *mc_stats_t;
77
78 XBT_PRIVATE extern mc_stats_t mc_stats;
79
80 XBT_PRIVATE void MC_print_statistics(mc_stats_t stats);
81
82 /********************************** Snapshot comparison **********************************/
83
84 //#define MC_DEBUG 1
85 #define MC_VERBOSE 1
86
87 /********************************** Miscellaneous **********************************/
88
89 XBT_PRIVATE void MC_report_assertion_error(void);
90 XBT_PRIVATE void MC_report_crash(int status);
91
92 SG_END_DECL()
93
94 #ifdef __cplusplus
95
96 namespace simgrid {
97 namespace mc {
98
99 XBT_PRIVATE void find_object_address(
100   std::vector<simgrid::xbt::VmMap> const& maps, simgrid::mc::ObjectInformation* result);
101
102 XBT_PRIVATE
103 int snapshot_compare(int num1, simgrid::mc::Snapshot* s1, int num2, simgrid::mc::Snapshot* s2);
104
105 // Move is somewhere else (in the LivenessChecker class, in the Session class?):
106 extern XBT_PRIVATE xbt_automaton_t property_automaton;
107
108 }
109 }
110
111 #endif
112
113 #endif