A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[mc] Use std::equal_range in get_search_range()
[simgrid.git]
/
src
/
mc
/
mc_safety.h
diff --git
a/src/mc/mc_safety.h
b/src/mc/mc_safety.h
index
8e47e89
..
0bbe379
100644
(file)
--- a/
src/mc/mc_safety.h
+++ b/
src/mc/mc_safety.h
@@
-1,4
+1,4
@@
-/* Copyright (c) 2007-201
4
. The SimGrid Team.
+/* Copyright (c) 2007-201
5
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-9,36
+9,44
@@
#include <stdint.h>
#include <stdint.h>
+#include <vector>
+#include <memory>
+
#include <simgrid_config.h>
#include <simgrid_config.h>
-#include <xbt/dict.h>
-#include "mc_forward.hpp"
-#include "mc_state.h"
-SG_BEGIN_DECL()
+#include <xbt/base.h>
+#include <xbt/dynar.h>
+
+#include "src/mc/mc_forward.hpp"
+#include "src/mc/mc_state.h"
+
+namespace simgrid {
+namespace mc {
-
typedef enum
{
-
e_mc_reduce_
unset,
-
e_mc_reduce_
none,
- e_mc_reduce_dpor
-}
e_mc_reduce_t
;
+
enum class ReductionMode
{
+ unset,
+ none,
+ dpor,
+};
-extern XBT_
INTERNAL e_mc_reduce_t mc_reduce_kind
;
+extern XBT_
PRIVATE simgrid::mc::ReductionMode reduction_mode
;
-void MC_modelcheck_safety(void);
+struct XBT_PRIVATE VisitedState {
+ simgrid::mc::Snapshot* system_state = nullptr;
+ size_t heap_bytes_used = 0;
+ int nb_processes = 0;
+ int num = 0;
+ int other_num = 0; // dot_output for
-typedef struct s_mc_visited_state{
- mc_snapshot_t system_state;
- size_t heap_bytes_used;
- int nb_processes;
- int num;
- int other_num; // dot_output for
-}s_mc_visited_state_t, *mc_visited_state_t;
+ VisitedState();
+ ~VisitedState();
+};
-extern XBT_INTERNAL xbt_dynar_t visited_states;
-XBT_INTERNAL mc_visited_state_t is_visited_state(mc_state_t graph_state);
-XBT_INTERNAL void visited_state_free(mc_visited_state_t state);
-XBT_INTERNAL void visited_state_free_voidp(void *s);
+extern XBT_PRIVATE std::vector<std::unique_ptr<simgrid::mc::VisitedState>> visited_states;
+XBT_PRIVATE std::unique_ptr<simgrid::mc::VisitedState> is_visited_state(mc_state_t graph_state);
+XBT_PRIVATE int snapshot_compare(simgrid::mc::VisitedState* state1, simgrid::mc::VisitedState* state2);
-SG_END_DECL()
+}
+}
#endif
#endif