Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
change src/include/surf.h into surf.hpp
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 5 Nov 2017 00:25:44 +0000 (01:25 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 5 Nov 2017 00:25:44 +0000 (01:25 +0100)
18 files changed:
src/include/surf/maxmin.hpp
src/include/surf/surf.hpp [moved from src/include/surf/surf.h with 90% similarity]
src/instr/instr_config.cpp
src/instr/instr_interface.cpp
src/kernel/activity/CommImpl.hpp
src/kernel/activity/ExecImpl.hpp
src/kernel/activity/SleepImpl.hpp
src/kernel/activity/SynchroIo.hpp
src/kernel/activity/SynchroRaw.hpp
src/kernel/context/Context.hpp
src/s4u/s4u_engine.cpp
src/simdag/simdag_private.hpp
src/simgrid/sg_config.cpp
src/simix/smx_io.cpp
src/surf/FileImpl.hpp
src/surf/instr_routing.cpp
src/surf/surf_interface.hpp
src/surf/surf_private.hpp

index e0dd9d7..bdf2977 100644 (file)
@@ -7,7 +7,7 @@
 #define SURF_MAXMIN_HPP
 
 #include "src/internal_config.h"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 #include "xbt/asserts.h"
 #include "xbt/misc.h"
 #include <cmath>
similarity index 90%
rename from src/include/surf/surf.h
rename to src/include/surf/surf.hpp
index 9fc3d95..3214e60 100644 (file)
@@ -6,23 +6,21 @@
 #ifndef SURF_SURF_H
 #define SURF_SURF_H
 
-#include "xbt/swag.h"
-#include "xbt/dynar.h"
+#include "simgrid/datatypes.h"
+#include "simgrid/forward.h"
+#include "src/internal_config.h"
+#include "surf/datatypes.h"
+#include "xbt/config.h"
 #include "xbt/dict.h"
+#include "xbt/dynar.h"
 #include "xbt/graph.h"
 #include "xbt/misc.h"
-#include "xbt/config.h"
-#include "src/internal_config.h"
-#include "surf/datatypes.h"
-#include "simgrid/datatypes.h"
-#include "simgrid/forward.h"
+#include "xbt/swag.h"
 
 #ifndef __cplusplus
 #error This is a C++ only file, now
 #endif
 
-#ifdef __cplusplus
-
 namespace simgrid {
 namespace surf {
 class Model;
@@ -35,46 +33,17 @@ class Action;
 }
 }
 
-typedef simgrid::surf::Model surf_Model;
-typedef simgrid::surf::CpuModel surf_CpuModel;
-typedef simgrid::surf::HostModel surf_HostModel;
-typedef simgrid::surf::NetworkModel surf_NetworkModel;
-typedef simgrid::surf::StorageModel surf_StorageModel;
-typedef simgrid::surf::Action surf_Action;
-
-#else
-
-typedef struct surf_Model surf_Model;
-typedef struct surf_CpuModel surf_CpuModel;
-typedef struct surf_HostModel surf_HostModel;
-typedef struct surf_NetworkModel surf_NetworkModel;
-typedef struct surf_StorageModel surf_StorageModel;
-typedef struct surf_Action surf_Action;
-
-#endif
-
-SG_BEGIN_DECL()
-/* Actions and models are highly connected structures... */
-
-/* user-visible parameters */
-extern XBT_PRIVATE double sg_tcp_gamma;
-extern XBT_PRIVATE double sg_latency_factor;
-extern XBT_PRIVATE double sg_bandwidth_factor;
-extern XBT_PRIVATE double sg_weight_S_parameter;
-extern XBT_PRIVATE int sg_network_crosstraffic;
-
 /** @ingroup SURF_c_bindings
  *  \brief Model datatype
  *
  *  Generic data structure for a model. The hosts,
  *  the CPUs and the network links are examples of models.
  */
-typedef surf_Model *surf_model_t;
-typedef surf_CpuModel *surf_cpu_model_t;
-typedef surf_HostModel *surf_host_model_t;
-typedef surf_NetworkModel *surf_network_model_t;
-typedef surf_StorageModel *surf_storage_model_t;
-
+typedef simgrid::surf::Model* surf_model_t;
+typedef simgrid::surf::CpuModel* surf_cpu_model_t;
+typedef simgrid::surf::HostModel* surf_host_model_t;
+typedef simgrid::surf::NetworkModel* surf_network_model_t;
+typedef simgrid::surf::StorageModel* surf_storage_model_t;
 /** @ingroup SURF_c_bindings
  *  \brief Action structure
  *
@@ -83,22 +52,29 @@ typedef surf_StorageModel *surf_storage_model_t;
  *
  *  \see e_surf_action_state_t
  */
-typedef surf_Action *surf_action_t;
+typedef simgrid::surf::Action* surf_action_t;
 
+SG_BEGIN_DECL()
+/* Actions and models are highly connected structures... */
+
+/* user-visible parameters */
+extern XBT_PRIVATE double sg_tcp_gamma;
+extern XBT_PRIVATE double sg_latency_factor;
+extern XBT_PRIVATE double sg_bandwidth_factor;
+extern XBT_PRIVATE double sg_weight_S_parameter;
+extern XBT_PRIVATE int sg_network_crosstraffic;
 
 /** \brief Resource model description
  */
 struct surf_model_description {
-  const char *name;
-  const char *description;
+  const charname;
+  const chardescription;
   void_f_void_t model_init_preparse;
 };
 typedef struct surf_model_description s_surf_model_description_t;
 
-#ifdef __cplusplus
 XBT_PUBLIC(int) find_model_description(s_surf_model_description_t* table, std::string name);
-#endif
-XBT_PUBLIC(void) model_help(const char *category, s_surf_model_description_t * table);
+XBT_PUBLIC(void) model_help(const char* category, s_surf_model_description_t* table);
 
 /***************************/
 /* Generic model object */
@@ -163,7 +139,6 @@ XBT_PUBLIC_DATA(surf_cpu_model_t) surf_cpu_model_pm;
  */
 XBT_PUBLIC_DATA(surf_cpu_model_t) surf_cpu_model_vm;
 
-
 /** \ingroup SURF_models
  *  \brief Initializes the CPU model with the model Cas01
  *
@@ -383,7 +358,7 @@ XBT_PUBLIC(void) surf_vm_model_init_HL13();
  *
  *  \see surf_host_model_init_CM02(), surf_host_model_init_compound(), surf_exit()
  */
-XBT_PUBLIC(void) surf_init(int *argc, char **argv);     /* initialize common structures */
+XBT_PUBLIC(void) surf_init(int* argc, char** argv); /* initialize common structures */
 
 /** \ingroup SURF_simulation
  *  \brief Finish simulation initialization
@@ -421,17 +396,17 @@ XBT_PUBLIC(double) surf_get_clock();
 XBT_PUBLIC(void) surf_exit();
 
 /* surf parse file related (public because called from a test suite) */
-XBT_PUBLIC(void) parse_platform_file(const char *file);
+XBT_PUBLIC(void) parse_platform_file(const charfile);
 
 /********** Tracing **********/
 /* from surf_instr.c */
-void TRACE_surf_action(surf_action_t surf_action, const char *category);
+void TRACE_surf_action(surf_action_t surf_action, const charcategory);
 
 /* instr_routing.c */
-void instr_routing_define_callbacks ();
-int instr_platform_traced ();
-xbt_graph_t instr_routing_platform_graph ();
-void instr_routing_platform_graph_export_graphviz (xbt_graph_t g, const char *filename);
+void instr_routing_define_callbacks();
+int instr_platform_traced();
+xbt_graph_t instr_routing_platform_graph();
+void instr_routing_platform_graph_export_graphviz(xbt_graph_t g, const char* filename);
 
 SG_END_DECL()
 
index 41b7c85..486b564 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "include/xbt/config.hpp"
 #include "src/instr/instr_private.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 #include <string>
 #include <vector>
 
index 432d0ef..8053955 100644 (file)
@@ -9,7 +9,7 @@
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/surf_private.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 #include <algorithm>
 
 enum InstrUserVariable { INSTR_US_DECLARE, INSTR_US_SET, INSTR_US_ADD, INSTR_US_SUB };
index 2eecc69..8480bb9 100644 (file)
@@ -7,7 +7,7 @@
 #define SIMIX_SYNCHRO_COMM_HPP
 
 #include "src/kernel/activity/ActivityImpl.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 
 enum e_smx_comm_type_t { SIMIX_COMM_SEND, SIMIX_COMM_RECEIVE, SIMIX_COMM_READY, SIMIX_COMM_DONE };
 
index 8012e39..2fe76ae 100644 (file)
@@ -7,7 +7,7 @@
 #define SIMIX_SYNCHRO_EXEC_HPP
 
 #include "src/kernel/activity/ActivityImpl.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 
 namespace simgrid {
 namespace kernel {
index a149ce5..5441f61 100644 (file)
@@ -7,7 +7,7 @@
 #define SIMIX_SYNCHRO_SLEEP_HPP
 
 #include "src/kernel/activity/ActivityImpl.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 
 namespace simgrid {
 namespace kernel {
index 2b6ab93..f827ac6 100644 (file)
@@ -6,8 +6,8 @@
 #ifndef SIMIX_SYNCHRO_IO_HPP
 #define SIMIX_SYNCHRO_IO_HPP
 
-#include "surf/surf.h"
 #include "src/kernel/activity/ActivityImpl.hpp"
+#include "surf/surf.hpp"
 
 namespace simgrid {
 namespace kernel {
index f5ef90d..d416f90 100644 (file)
@@ -6,8 +6,8 @@
 #ifndef SIMIX_SYNCHRO_RAW_HPP
 #define SIMIX_SYNCHRO_RAW_HPP
 
-#include "surf/surf.h"
 #include "src/kernel/activity/ActivityImpl.hpp"
+#include "surf/surf.hpp"
 
 namespace simgrid {
 namespace kernel {
index c467f05..7b53ca9 100644 (file)
@@ -21,7 +21,7 @@
 #include "src/simix/smx_io_private.hpp"
 #include "src/simix/smx_network_private.hpp"
 #include "src/simix/smx_synchro_private.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 #include "xbt/base.h"
 #include "xbt/config.h"
 #include "xbt/function_types.h"
index 39e5922..c16b189 100644 (file)
@@ -17,7 +17,7 @@
 #include "src/kernel/routing/NetPoint.hpp"
 #include "src/kernel/routing/NetZoneImpl.hpp"
 #include "src/surf/network_interface.hpp"
-#include "surf/surf.h" // routing_platf. FIXME:KILLME. SOON
+#include "surf/surf.hpp" // routing_platf. FIXME:KILLME. SOON
 
 XBT_LOG_NEW_CATEGORY(s4u,"Log channels of the S4U (Simgrid for you) interface");
 
index 6b14965..13d55f4 100644 (file)
@@ -4,11 +4,11 @@
 /* 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. */
 
+#include "simgrid/simdag.h"
+#include "surf/surf.hpp"
 #include <set>
 #include <string>
 #include <vector>
-#include "simgrid/simdag.h"
-#include "surf/surf.h"
 
 #ifndef SIMDAG_PRIVATE_HPP
 #define SIMDAG_PRIVATE_HPP
index c8a6579..9158528 100644 (file)
@@ -15,7 +15,7 @@
 #include "src/mc/mc_replay.h"
 #include "src/surf/surf_interface.hpp"
 #include "surf/maxmin.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 #include "xbt/config.h"
 #include "xbt/config.hpp"
 #include "xbt/log.h"
index 90c7f88..dc04477 100644 (file)
@@ -12,7 +12,7 @@
 #include "src/surf/FileImpl.hpp"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/StorageImpl.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 
 #include "smx_private.hpp"
 #include "src/surf/surf_interface.hpp"
index 94337fe..acb8f27 100644 (file)
@@ -7,7 +7,7 @@
 #ifndef SRC_SURF_FILEIMPL_HPP_
 #define SRC_SURF_FILEIMPL_HPP_
 
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 #include <string>
 
 namespace simgrid {
index b5d1eb8..6a271cd 100644 (file)
@@ -7,11 +7,11 @@
 
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
-#include "src/kernel/routing/NetZoneImpl.hpp"
 #include "src/kernel/routing/NetPoint.hpp"
+#include "src/kernel/routing/NetZoneImpl.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 #include "xbt/graph.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_routing, instr, "Tracing platform hierarchy");
index 32e6ec3..5cad6fe 100644 (file)
@@ -9,7 +9,7 @@
 #include "xbt/signal.hpp"
 
 #include "src/surf/surf_private.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 #include "xbt/str.h"
 
 #include <boost/intrusive/list.hpp>
index 3318125..55a7e4f 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/surf/trace_mgr.hpp"
 #include "surf/maxmin.hpp"
-#include "surf/surf.h"
+#include "surf/surf.hpp"
 
 #define NO_MAX_DURATION -1.0