Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Move VisitedState stuffs in their own .c file
authorGabriel Corona <gabriel.corona@loria.fr>
Mon, 4 Apr 2016 14:18:13 +0000 (16:18 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Mon, 4 Apr 2016 14:28:59 +0000 (16:28 +0200)
src/mc/CommunicationDeterminismChecker.cpp
src/mc/SafetyChecker.cpp
src/mc/VisitedState.cpp [moved from src/mc/mc_visited.cpp with 98% similarity]
src/mc/VisitedState.hpp [new file with mode: 0644]
src/mc/mc_safety.h
src/xbt/log.c
tools/cmake/DefinePackages.cmake

index ae4e36c..6eedc7e 100644 (file)
@@ -22,6 +22,7 @@
 #include "src/mc/Client.hpp"
 #include "src/mc/CommunicationDeterminismChecker.hpp"
 #include "src/mc/mc_exit.h"
+#include "src/mc/VisitedState.hpp"
 
 using simgrid::mc::remote;
 
index 5dd75dc..4269891 100644 (file)
@@ -25,6 +25,7 @@
 #include "src/mc/mc_exit.h"
 #include "src/mc/Checker.hpp"
 #include "src/mc/SafetyChecker.hpp"
+#include "src/mc/VisitedState.hpp"
 
 #include "src/xbt/mmalloc/mmprivate.h"
 
similarity index 98%
rename from src/mc/mc_visited.cpp
rename to src/mc/VisitedState.cpp
index d6de75a..3745922 100644 (file)
@@ -21,8 +21,9 @@
 #include "src/mc/mc_private.h"
 #include "src/mc/Process.hpp"
 #include "src/mc/mc_smx.h"
+#include "src/mc/VisitedState.hpp"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_visited, mc,
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_VisitedState, mc,
                                 "Logging specific to state equaity detection mechanisms");
 
 namespace simgrid {
diff --git a/src/mc/VisitedState.hpp b/src/mc/VisitedState.hpp
new file mode 100644 (file)
index 0000000..4e0c4fb
--- /dev/null
@@ -0,0 +1,36 @@
+/* Copyright (c) 2007-2016. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef SIMGRID_MC_VISITED_STATE_HPP
+#define SIMGRID_MC_VISITED_STATE_HPP
+
+#include <cstddef>
+
+#include <memory>
+
+#include "src/mc/mc_snapshot.h"
+
+namespace simgrid {
+namespace mc {
+
+struct XBT_PRIVATE VisitedState {
+  std::shared_ptr<simgrid::mc::Snapshot> system_state = nullptr;
+  std::size_t heap_bytes_used = 0;
+  int nb_processes = 0;
+  int num = 0;
+  int other_num = 0; // dot_output for
+
+  VisitedState();
+  ~VisitedState();
+};
+
+extern XBT_PRIVATE std::vector<std::unique_ptr<simgrid::mc::VisitedState>> visited_states;
+XBT_PRIVATE std::unique_ptr<simgrid::mc::VisitedState> is_visited_state(simgrid::mc::State* graph_state, bool compare_snpashots);
+
+}
+}
+
+#endif
index 60c177f..b1cd987 100644 (file)
@@ -31,20 +31,6 @@ enum class ReductionMode {
 
 extern XBT_PRIVATE simgrid::mc::ReductionMode reduction_mode;
 
-struct XBT_PRIVATE VisitedState {
-  std::shared_ptr<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
-
-  VisitedState();
-  ~VisitedState();
-};
-
-extern XBT_PRIVATE std::vector<std::unique_ptr<simgrid::mc::VisitedState>> visited_states;
-XBT_PRIVATE std::unique_ptr<simgrid::mc::VisitedState> is_visited_state(simgrid::mc::State* graph_state, bool compare_snpashots);
-
 }
 }
 
index ae4b051..f76b348 100644 (file)
@@ -629,7 +629,7 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(mc_page_snapshot);
   XBT_LOG_CONNECT(mc_request);
   XBT_LOG_CONNECT(mc_safety);
-  XBT_LOG_CONNECT(mc_visited);
+  XBT_LOG_CONNECT(mc_VisitedState);
   XBT_LOG_CONNECT(mc_client);
   XBT_LOG_CONNECT(mc_client_api);
   XBT_LOG_CONNECT(mc_comm_pattern);
index 05a1e89..a2ed64b 100644 (file)
@@ -609,7 +609,8 @@ set(MC_SRC
   src/mc/mc_safety.h
   src/mc/mc_state.h
   src/mc/mc_state.cpp
-  src/mc/mc_visited.cpp
+  src/mc/VisitedState.cpp
+  src/mc/VisitedState.hpp
   src/mc/mc_client_api.cpp
   src/mc/mc_protocol.h
   src/mc/mc_protocol.cpp