From 8d51fbcc2374aec305440e6456aee54c0a2df5d3 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 18 Apr 2018 17:30:37 +0200 Subject: [PATCH] Create mc_config.hpp for MC's configuration stuff. --- src/include/mc/mc.h | 30 ------------------------ src/mc/RegionSnapshot.cpp | 1 + src/mc/compare.cpp | 1 + src/mc/mc_base.cpp | 1 + src/mc/mc_checkpoint.cpp | 1 + src/mc/mc_config.hpp | 39 ++++++++++++++++++++++++++++++++ src/mc/mc_record.hpp | 1 + src/mc/mc_snapshot.cpp | 1 + src/simgrid/sg_config.cpp | 2 +- tools/cmake/DefinePackages.cmake | 1 + 10 files changed, 47 insertions(+), 31 deletions(-) create mode 100644 src/mc/mc_config.hpp diff --git a/src/include/mc/mc.h b/src/include/mc/mc.h index 3119413da9..bdaa8a4b7a 100644 --- a/src/include/mc/mc.h +++ b/src/include/mc/mc.h @@ -24,37 +24,7 @@ SG_BEGIN_DECL() -/********************************** Configuration of MC **************************************/ -extern XBT_PUBLIC int _sg_do_model_check; -extern XBT_PRIVATE int _sg_do_model_check_record; -extern XBT_PRIVATE int _sg_mc_checkpoint; -extern XBT_PUBLIC int _sg_mc_sparse_checkpoint; -extern XBT_PUBLIC int _sg_mc_ksm; -extern XBT_PRIVATE int _sg_mc_timeout; -extern XBT_PRIVATE int _sg_mc_hash; -extern XBT_PRIVATE int _sg_mc_max_depth; -extern XBT_PUBLIC int _sg_mc_max_visited_states; -extern XBT_PUBLIC int _sg_mc_comms_determinism; -extern XBT_PUBLIC int _sg_mc_send_determinism; -extern XBT_PRIVATE int _sg_mc_snapshot_fds; -extern XBT_PRIVATE int _sg_mc_termination; - /********************************* Global *************************************/ -XBT_PRIVATE void _mc_cfg_cb_reduce(const char *name); -XBT_PRIVATE void _mc_cfg_cb_checkpoint(const char *name); -XBT_PRIVATE void _mc_cfg_cb_sparse_checkpoint(const char *name); -XBT_PRIVATE void _mc_cfg_cb_ksm(const char *name); -XBT_PRIVATE void _mc_cfg_cb_property(const char *name); -XBT_PRIVATE void _mc_cfg_cb_timeout(const char *name); -XBT_PRIVATE void _mc_cfg_cb_snapshot_fds(const char *name); -XBT_PRIVATE void _mc_cfg_cb_hash(const char *name); -XBT_PRIVATE void _mc_cfg_cb_max_depth(const char *name); -XBT_PRIVATE void _mc_cfg_cb_visited(const char *name); -XBT_PRIVATE void _mc_cfg_cb_dot_output(const char *name); -XBT_PRIVATE void _mc_cfg_cb_comms_determinism(const char *name); -XBT_PRIVATE void _mc_cfg_cb_send_determinism(const char *name); -XBT_PRIVATE void _mc_cfg_cb_termination(const char *name); - XBT_PUBLIC void MC_run(); XBT_PUBLIC void MC_process_clock_add(smx_actor_t, double); XBT_PUBLIC double MC_process_clock_get(smx_actor_t); diff --git a/src/mc/RegionSnapshot.cpp b/src/mc/RegionSnapshot.cpp index eee6962303..a659f9ae6f 100644 --- a/src/mc/RegionSnapshot.cpp +++ b/src/mc/RegionSnapshot.cpp @@ -12,6 +12,7 @@ #endif #include "mc/mc.h" +#include "src/mc/mc_config.hpp" #include "src/mc/mc_snapshot.hpp" #include "src/mc/ChunkedData.hpp" diff --git a/src/mc/compare.cpp b/src/mc/compare.cpp index 652c6521bf..efbd0efeab 100644 --- a/src/mc/compare.cpp +++ b/src/mc/compare.cpp @@ -32,6 +32,7 @@ #include "src/mc/ObjectInformation.hpp" #include "src/mc/Type.hpp" #include "src/mc/Variable.hpp" +#include "src/mc/mc_config.hpp" #include "src/mc/mc_dwarf.hpp" #include "src/mc/mc_forward.hpp" #include "src/mc/mc_private.hpp" diff --git a/src/mc/mc_base.cpp b/src/mc/mc_base.cpp index 5433989c30..384283fd33 100644 --- a/src/mc/mc_base.cpp +++ b/src/mc/mc_base.cpp @@ -7,6 +7,7 @@ #include "mc/mc.h" #include "src/mc/mc_base.h" +#include "src/mc/mc_config.hpp" #include "src/mc/mc_replay.hpp" #include "src/simix/smx_private.hpp" diff --git a/src/mc/mc_checkpoint.cpp b/src/mc/mc_checkpoint.cpp index 017562d1ae..018a0db685 100644 --- a/src/mc/mc_checkpoint.cpp +++ b/src/mc/mc_checkpoint.cpp @@ -32,6 +32,7 @@ #include "src/mc/mc_private.hpp" #include +#include "src/mc/mc_config.hpp" #include "src/mc/mc_hash.hpp" #include "src/mc/mc_mmu.hpp" #include "src/mc/mc_smx.hpp" diff --git a/src/mc/mc_config.hpp b/src/mc/mc_config.hpp new file mode 100644 index 0000000000..343c93a974 --- /dev/null +++ b/src/mc/mc_config.hpp @@ -0,0 +1,39 @@ +/* Copyright (c) 2018. 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 MC_CONFIG_HPP +#define MC_CONFIG_HPP + +/********************************** Configuration of MC **************************************/ +extern "C" XBT_PUBLIC int _sg_do_model_check; +extern XBT_PRIVATE int _sg_do_model_check_record; +extern XBT_PRIVATE int _sg_mc_checkpoint; +extern XBT_PUBLIC int _sg_mc_sparse_checkpoint; +extern XBT_PUBLIC int _sg_mc_ksm; +extern XBT_PRIVATE int _sg_mc_timeout; +extern XBT_PRIVATE int _sg_mc_hash; +extern XBT_PRIVATE int _sg_mc_max_depth; +extern "C" XBT_PUBLIC int _sg_mc_max_visited_states; +extern XBT_PUBLIC int _sg_mc_comms_determinism; +extern XBT_PUBLIC int _sg_mc_send_determinism; +extern XBT_PRIVATE int _sg_mc_snapshot_fds; +extern XBT_PRIVATE int _sg_mc_termination; + +XBT_PRIVATE void _mc_cfg_cb_reduce(const char* name); +XBT_PRIVATE void _mc_cfg_cb_checkpoint(const char* name); +XBT_PRIVATE void _mc_cfg_cb_sparse_checkpoint(const char* name); +XBT_PRIVATE void _mc_cfg_cb_ksm(const char* name); +XBT_PRIVATE void _mc_cfg_cb_property(const char* name); +XBT_PRIVATE void _mc_cfg_cb_timeout(const char* name); +XBT_PRIVATE void _mc_cfg_cb_snapshot_fds(const char* name); +XBT_PRIVATE void _mc_cfg_cb_hash(const char* name); +XBT_PRIVATE void _mc_cfg_cb_max_depth(const char* name); +XBT_PRIVATE void _mc_cfg_cb_visited(const char* name); +XBT_PRIVATE void _mc_cfg_cb_dot_output(const char* name); +XBT_PRIVATE void _mc_cfg_cb_comms_determinism(const char* name); +XBT_PRIVATE void _mc_cfg_cb_send_determinism(const char* name); +XBT_PRIVATE void _mc_cfg_cb_termination(const char* name); + +#endif diff --git a/src/mc/mc_record.hpp b/src/mc/mc_record.hpp index 7cfea8fffc..34ecd200d9 100644 --- a/src/mc/mc_record.hpp +++ b/src/mc/mc_record.hpp @@ -18,6 +18,7 @@ #define SIMGRID_MC_RECORD_HPP #include "src/mc/Transition.hpp" +#include "src/mc/mc_config.hpp" #include "xbt/base.h" #include diff --git a/src/mc/mc_snapshot.cpp b/src/mc/mc_snapshot.cpp index 391fef8075..27acf54a3a 100644 --- a/src/mc/mc_snapshot.cpp +++ b/src/mc/mc_snapshot.cpp @@ -182,6 +182,7 @@ const void* Snapshot::read_bytes(void* buffer, std::size_t size, #include +#include "src/mc/mc_config.hpp" #include "src/mc/mc_mmu.hpp" #include "src/mc/mc_private.hpp" #include "src/mc/mc_snapshot.hpp" diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index 5f56a50aa7..e5bd9af6de 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -7,10 +7,10 @@ #include "simgrid/sg_config.hpp" #include "instr/instr_interface.hpp" -#include "mc/mc.h" #include "simgrid/instr.h" #include "src/internal_config.h" #include "src/kernel/lmm/maxmin.hpp" +#include "src/mc/mc_config.hpp" #include "src/mc/mc_replay.hpp" #include "src/surf/surf_interface.hpp" #include "surf/surf.hpp" diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 19a3eaac07..43d0ae06ae 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -576,6 +576,7 @@ set(MC_SRC_BASE src/mc/mc_replay.hpp src/mc/mc_record.cpp src/mc/mc_config.cpp + src/mc/mc_config.hpp src/mc/mc_global.cpp ) -- 2.20.1