Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] C++ification of State
[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 void MC_show_deadlock(void);
67
68 /****************************** Statistics ************************************/
69
70 typedef struct mc_stats {
71   unsigned long state_size;
72   unsigned long visited_states;
73   unsigned long visited_pairs;
74   unsigned long expanded_states;
75   unsigned long expanded_pairs;
76   unsigned long executed_transitions;
77 } s_mc_stats_t, *mc_stats_t;
78
79 XBT_PRIVATE extern mc_stats_t mc_stats;
80
81 XBT_PRIVATE void MC_print_statistics(mc_stats_t stats);
82
83 /********************************** Snapshot comparison **********************************/
84
85 //#define MC_DEBUG 1
86 #define MC_VERBOSE 1
87
88 /********************************** Miscellaneous **********************************/
89
90 XBT_PRIVATE void MC_report_assertion_error(void);
91 XBT_PRIVATE void MC_report_crash(int status);
92
93 SG_END_DECL()
94
95 #ifdef __cplusplus
96
97 namespace simgrid {
98 namespace mc {
99
100 XBT_PRIVATE void find_object_address(
101   std::vector<simgrid::xbt::VmMap> const& maps, simgrid::mc::ObjectInformation* result);
102
103 XBT_PRIVATE
104 int snapshot_compare(int num1, simgrid::mc::Snapshot* s1, int num2, simgrid::mc::Snapshot* s2);
105
106 // Move is somewhere else (in the LivenessChecker class, in the Session class?):
107 extern XBT_PRIVATE xbt_automaton_t property_automaton;
108
109 }
110 }
111
112 #endif
113
114 #endif