Logo AND Algorithmique Numérique Distribuée

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