Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
banish some surf parsing files to a src/surf/xml jail
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 21 Feb 2016 00:42:34 +0000 (01:42 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 21 Feb 2016 01:48:36 +0000 (02:48 +0100)
The ultimate goal is to make them useless, then deprecated, then gone.

45 files changed:
.gitignore
include/surf/surf_routing.h
src/bindings/lua/lua_platf.cpp
src/bindings/lua/simgrid_lua.cpp
src/include/simgrid/platf_interface.h [deleted file]
src/include/surf/surf.h
src/instr/instr_private.h
src/msg/msg_global.cpp
src/msg/msg_vm.cpp
src/simgrid/sg_config.c
src/simix/smx_deployment.cpp
src/simix/smx_environment.cpp
src/simix/smx_global.cpp
src/surf/cpu_cas01.cpp
src/surf/cpu_ti.cpp
src/surf/instr_routing.cpp
src/surf/network_cm02.cpp
src/surf/network_constant.cpp
src/surf/network_ib.cpp
src/surf/network_ns3.cpp
src/surf/network_smpi.cpp
src/surf/platform.hpp [deleted file]
src/surf/ptask_L07.cpp
src/surf/sg_platf.cpp
src/surf/storage_n11.cpp
src/surf/surf_interface.hpp
src/surf/surf_private.h
src/surf/surf_routing.cpp
src/surf/surf_routing_RoutedGraph.cpp
src/surf/surf_routing_cluster_fat_tree.cpp
src/surf/surf_routing_cluster_torus.cpp
src/surf/trace_mgr.hpp
src/surf/xml/platf.hpp [moved from include/surf/surfxml_parse.h with 65% similarity]
src/surf/xml/platf_private.hpp [moved from include/simgrid/platf.h with 86% similarity]
src/surf/xml/simgrid.dtd [moved from src/surf/simgrid.dtd with 100% similarity]
src/surf/xml/simgrid_dtd.c [moved from src/surf/simgrid_dtd.c with 99% similarity]
src/surf/xml/simgrid_dtd.h [moved from include/surf/simgrid_dtd.h with 99% similarity]
src/surf/xml/surfxml_parseplatf.cpp [moved from src/surf/surfxml_parseplatf.cpp with 99% similarity]
src/surf/xml/surfxml_sax_cb.cpp [moved from src/surf/surfxml_parse.cpp with 99% similarity]
teshsuite/simix/stack_overflow/stack_overflow.c
teshsuite/surf/surf_usage/surf_usage.cpp
teshsuite/surf/surf_usage/surf_usage2.cpp
tools/cmake/DefinePackages.cmake
tools/cmake/Documentation.cmake
tools/cmake/MaintainerMode.cmake

index ed2757e..be91017 100644 (file)
@@ -23,7 +23,7 @@ CTestResults.xml
 
 ### Maintainer mode
 src/simdag/dax_dtd.l
 
 ### Maintainer mode
 src/simdag/dax_dtd.l
-src/surf/simgrid_dtd.l
+src/surf/xml/simgrid_dtd.l
 src/xbt/graphxml.l
 ### Jedule
 examples/simdag/scheduling/simgrid.jed
 src/xbt/graphxml.l
 ### Jedule
 examples/simdag/scheduling/simgrid.jed
index 67434ae..c846b77 100644 (file)
@@ -8,7 +8,6 @@
 #define _SURF_SURF_ROUTING_H
 
 #include "xbt/lib.h"
 #define _SURF_SURF_ROUTING_H
 
 #include "xbt/lib.h"
-#include "simgrid/platf.h"
 
 SG_BEGIN_DECL()
 
 
 SG_BEGIN_DECL()
 
index 18ae0e2..0cf495a 100644 (file)
@@ -7,8 +7,7 @@
 /* SimGrid Lua bindings                                                     */
 
 #include "lua_private.h"
 /* SimGrid Lua bindings                                                     */
 
 #include "lua_private.h"
-#include "simgrid/platf_interface.h"
-#include "surf/surfxml_parse.h"
+#include "src/surf/xml/platf.hpp"
 #include "surf/surf_routing.h"
 #include <string.h>
 #include <ctype.h>
 #include "surf/surf_routing.h"
 #include <string.h>
 #include <ctype.h>
@@ -361,8 +360,6 @@ int console_add_router(lua_State* L) {
   return 0;
 }
 
   return 0;
 }
 
-#include "surf/surfxml_parse.h" /* to override surf_parse and bypass the parser */
-
 int console_add_route(lua_State *L) {
   XBT_DEBUG("Adding route");
   s_sg_platf_route_cbarg_t route;
 int console_add_route(lua_State *L) {
   XBT_DEBUG("Adding route");
   s_sg_platf_route_cbarg_t route;
index ce5fed9..ea77144 100644 (file)
@@ -8,10 +8,7 @@
 
 #include "lua_private.h"
 #include "lua_utils.h"
 
 #include "lua_private.h"
 #include "lua_utils.h"
-#include "xbt.h"
-#include "simgrid/msg.h"
-#include "simgrid/simdag.h"
-#include "surf/surfxml_parse.h"
+#include "src/surf/xml/platf.hpp"
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua, bindings, "Lua Bindings");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua, bindings, "Lua Bindings");
diff --git a/src/include/simgrid/platf_interface.h b/src/include/simgrid/platf_interface.h
deleted file mode 100644 (file)
index 6ed6cef..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* platf_interface.h - Internal interface to the SimGrid platforms          */
-
-/* Copyright (c) 2004-2007, 2009-2015. 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 SG_PLATF_INTERFACE_H
-#define SG_PLATF_INTERFACE_H
-
-#include <xbt/dict.h>
-
-#include "simgrid/platf.h" /* public interface */
-#include "xbt/RngStream.h"
-
-#include <simgrid/forward.h>
-
-SG_BEGIN_DECL()
-
-/* Module management functions */
-XBT_PUBLIC(void) sg_platf_init(void);
-XBT_PUBLIC(void) sg_platf_exit(void);
-
-/** \brief Pick the right models for CPU, net and host, and call their model_init_preparse
- *
- * Must be called within parsing/creating the environment (after the <config>s, if any, and before <AS> or friends such as <cluster>)
- */
-XBT_PUBLIC(void) surf_config_models_setup(void);
-
-SG_END_DECL()
-
-#endif                          /* SG_PLATF_INTERFACE_H */
index e2dcd5b..d0c563f 100644 (file)
@@ -18,7 +18,6 @@
 #include "surf/datatypes.h"
 #include "xbt/lib.h"
 #include "surf/surf_routing.h"
 #include "surf/datatypes.h"
 #include "xbt/lib.h"
 #include "surf/surf_routing.h"
-#include "simgrid/platf_interface.h"
 #include "simgrid/datatypes.h"
 #include "simgrid/forward.h"
 
 #include "simgrid/datatypes.h"
 #include "simgrid/forward.h"
 
@@ -995,11 +994,6 @@ int instr_platform_traced (void);
 xbt_graph_t instr_routing_platform_graph (void);
 void instr_routing_platform_graph_export_graphviz (xbt_graph_t g, const char *filename);
 
 xbt_graph_t instr_routing_platform_graph (void);
 void instr_routing_platform_graph_export_graphviz (xbt_graph_t g, const char *filename);
 
-/********** Routing **********/
-void routing_AS_begin(sg_platf_AS_cbarg_t AS);
-void routing_AS_end(void);
-void routing_cluster_add_backbone(Link* bb);
-surf_As* routing_get_current();
 
 SG_END_DECL()
 #endif                          /* _SURF_SURF_H */
 
 SG_END_DECL()
 #endif                          /* _SURF_SURF_H */
index 0bcb00f..c9aeb64 100644 (file)
@@ -26,7 +26,6 @@ SG_BEGIN_DECL()
 
 #include "xbt/graph.h"
 #include "xbt/dict.h"
 
 #include "xbt/graph.h"
 #include "xbt/dict.h"
-#include "simgrid/platf.h"
 
 typedef enum {
   PAJE_DefineContainerType,
 
 typedef enum {
   PAJE_DefineContainerType,
index d2f631b..4d5d20d 100644 (file)
@@ -16,7 +16,7 @@
 #include "xbt/replay.h"
 #include "simgrid/sg_config.h" /* Configuration mechanism of SimGrid */
 #include "src/surf/callbacks.h"
 #include "xbt/replay.h"
 #include "simgrid/sg_config.h" /* Configuration mechanism of SimGrid */
 #include "src/surf/callbacks.h"
-#include "src/surf/platform.hpp"
+#include "src/surf/xml/platf_private.hpp" // FIXME: KILLME by removing MSG_post_create_environment()
 
 XBT_LOG_NEW_CATEGORY(msg, "All MSG categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_kernel, msg,
 
 XBT_LOG_NEW_CATEGORY(msg, "All MSG categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_kernel, msg,
index cbfb739..4b360b7 100644 (file)
@@ -15,7 +15,6 @@
 #include "msg_private.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "msg_private.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
-#include "simgrid/platf.h"
 #include "simgrid/host.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_vm, msg,
 #include "simgrid/host.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_vm, msg,
index 4a9c9d7..74f19c4 100644 (file)
@@ -949,75 +949,6 @@ void sg_config_finalize(void)
   _sg_cfg_init_status = 0;
 }
 
   _sg_cfg_init_status = 0;
 }
 
-/* Pick the right models for CPU, net and host, and call their model_init_preparse */
-void surf_config_models_setup()
-{
-  const char *host_model_name;
-  const char *vm_model_name;
-  int host_id = -1;
-  int vm_id = -1;
-  char *network_model_name = NULL;
-  char *cpu_model_name = NULL;
-  int storage_id = -1;
-  char *storage_model_name = NULL;
-
-  host_model_name = xbt_cfg_get_string(_sg_cfg_set, "host/model");
-  vm_model_name = xbt_cfg_get_string(_sg_cfg_set, "vm/model");
-  network_model_name = xbt_cfg_get_string(_sg_cfg_set, "network/model");
-  cpu_model_name = xbt_cfg_get_string(_sg_cfg_set, "cpu/model");
-  storage_model_name = xbt_cfg_get_string(_sg_cfg_set, "storage/model");
-
-  /* Check whether we use a net/cpu model differing from the default ones, in which case
-   * we should switch to the "compound" host model to correctly dispatch stuff to
-   * the right net/cpu models.
-   */
-
-  if ((!xbt_cfg_is_default_value(_sg_cfg_set, "network/model") ||
-       !xbt_cfg_is_default_value(_sg_cfg_set, "cpu/model")) &&
-      xbt_cfg_is_default_value(_sg_cfg_set, "host/model")) {
-    host_model_name = "compound";
-    xbt_cfg_set_string(_sg_cfg_set, "host/model", host_model_name);
-  }
-
-  XBT_DEBUG("host model: %s", host_model_name);
-  host_id = find_model_description(surf_host_model_description, host_model_name);
-  if (!strcmp(host_model_name, "compound")) {
-    int network_id = -1;
-    int cpu_id = -1;
-
-    xbt_assert(cpu_model_name,
-                "Set a cpu model to use with the 'compound' host model");
-
-    xbt_assert(network_model_name,
-                "Set a network model to use with the 'compound' host model");
-
-    if(surf_cpu_model_init_preparse){
-      surf_cpu_model_init_preparse();
-    } else {
-      cpu_id =
-          find_model_description(surf_cpu_model_description, cpu_model_name);
-      surf_cpu_model_description[cpu_id].model_init_preparse();
-    }
-
-    network_id =
-        find_model_description(surf_network_model_description,
-                               network_model_name);
-    surf_network_model_description[network_id].model_init_preparse();
-  }
-
-  XBT_DEBUG("Call host_model_init");
-  surf_host_model_description[host_id].model_init_preparse();
-
-  XBT_DEBUG("Call vm_model_init");
-  vm_id = find_model_description(surf_vm_model_description, vm_model_name);
-  surf_vm_model_description[vm_id].model_init_preparse();
-
-  XBT_DEBUG("Call storage_model_init");
-  storage_id = find_model_description(surf_storage_model_description, storage_model_name);
-  surf_storage_model_description[storage_id].model_init_preparse();
-
-}
-
 int sg_cfg_is_default_value(const char *name)
 {
   return xbt_cfg_is_default_value(_sg_cfg_set, name);
 int sg_cfg_is_default_value(const char *name)
 {
   return xbt_cfg_is_default_value(_sg_cfg_set, name);
index cc101f7..08a8727 100644 (file)
@@ -8,7 +8,7 @@
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "xbt/dict.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "xbt/dict.h"
-#include "surf/surfxml_parse.h"
+#include "src/surf/xml/platf_private.hpp" // FIXME: KILLME. There must be a better way than mimicking XML here
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_deployment, simix,
                                 "Logging specific to SIMIX (deployment)");
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_deployment, simix,
                                 "Logging specific to SIMIX (deployment)");
index 9b4c6db..279e6ea 100644 (file)
@@ -9,7 +9,6 @@
 #include "xbt/log.h"
 #include "xbt/xbt_os_time.h"
 #include "xbt/config.h"
 #include "xbt/log.h"
 #include "xbt/xbt_os_time.h"
 #include "xbt/config.h"
-#include "surf/surfxml_parse.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix,
                                 "Logging specific to SIMIX (environment)");
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix,
                                 "Logging specific to SIMIX (environment)");
index c2bc81b..54cf74d 100644 (file)
@@ -37,7 +37,6 @@
 #endif 
 
 #include "src/mc/mc_record.h"
 #endif 
 
 #include "src/mc/mc_record.h"
-#include "src/surf/platform.hpp"
 
 #ifdef HAVE_SMPI
 #include "src/smpi/private.h"
 
 #ifdef HAVE_SMPI
 #include "src/smpi/private.h"
index a3dec9a..3f1ab84 100644 (file)
@@ -8,7 +8,6 @@
 #include "cpu_ti.hpp"
 #include "maxmin_private.hpp"
 #include "simgrid/sg_config.h"
 #include "cpu_ti.hpp"
 #include "maxmin_private.hpp"
 #include "simgrid/sg_config.h"
-#include "src/surf/platform.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_cas, surf_cpu,
                                 "Logging specific to the SURF CPU IMPROVED module");
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_cas, surf_cpu,
                                 "Logging specific to the SURF CPU IMPROVED module");
index 724a9c5..2cc517e 100644 (file)
@@ -7,7 +7,6 @@
 #include "cpu_ti.hpp"
 #include "xbt/heap.h"
 #include "src/surf/trace_mgr.hpp"
 #include "cpu_ti.hpp"
 #include "xbt/heap.h"
 #include "src/surf/trace_mgr.hpp"
-#include "src/surf/platform.hpp"
 
 #ifndef SURF_MODEL_CPUTI_H_
 #define SURF_MODEL_CPUTI_H_
 
 #ifndef SURF_MODEL_CPUTI_H_
 #define SURF_MODEL_CPUTI_H_
index ce605c0..e79947a 100644 (file)
@@ -8,7 +8,6 @@
 
 #include "src/surf/surf_private.h"
 #include "xbt/graph.h"
 
 #include "src/surf/surf_private.h"
 #include "xbt/graph.h"
-#include "src/surf/platform.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_routing, instr, "Tracing platform hierarchy");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_routing, instr, "Tracing platform hierarchy");
 
index 6915a08..a178748 100644 (file)
@@ -9,7 +9,6 @@
 #include "network_cm02.hpp"
 #include "maxmin_private.hpp"
 #include "simgrid/sg_config.h"
 #include "network_cm02.hpp"
 #include "maxmin_private.hpp"
 #include "simgrid/sg_config.h"
-#include "src/surf/platform.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
index 6114f6f..533be80 100644 (file)
@@ -6,9 +6,6 @@
 
 #include "network_constant.hpp"
 
 
 #include "network_constant.hpp"
 
-#include "host_interface.hpp"
-#include "src/surf/platform.hpp"
-
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
 /*********
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
 /*********
index 5f52e8c..5e995d1 100644 (file)
@@ -104,7 +104,7 @@ void surf_network_model_init_IB(void)
   
 }
 
   
 }
 
-#include <surf/surfxml_parse.h> // FIXME: move that back to the parsing area
+#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
 
 namespace simgrid {
 namespace surf {
 
 namespace simgrid {
 namespace surf {
index 1711529..a14c184 100644 (file)
@@ -8,7 +8,6 @@
 #include "src/surf/surf_private.h"
 #include "src/surf/host_interface.hpp"
 #include "simgrid/sg_config.h"
 #include "src/surf/surf_private.h"
 #include "src/surf/host_interface.hpp"
 #include "simgrid/sg_config.h"
-#include "src/surf/platform.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ns3);
 
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(ns3);
 
@@ -65,7 +64,7 @@ static void parse_ns3_add_AS(simgrid::surf::As* as)
   xbt_lib_set(as_router_lib, as_id, NS3_ASR_LEVEL, ns3_add_AS(as_id) );
 }
 
   xbt_lib_set(as_router_lib, as_id, NS3_ASR_LEVEL, ns3_add_AS(as_id) );
 }
 
-#include <surf/surfxml_parse.h> // FIXME: move that back to the parsing area
+#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
 static void parse_ns3_add_cluster(sg_platf_cluster_cbarg_t cluster)
 {
   const char *groups = NULL;
 static void parse_ns3_add_cluster(sg_platf_cluster_cbarg_t cluster)
 {
   const char *groups = NULL;
index 004dec9..b9d8d15 100644 (file)
@@ -32,7 +32,7 @@ static int factor_cmp(const void *pa, const void *pb)
          (((s_smpi_factor_t*)pa)->factor < ((s_smpi_factor_t*)pb)->factor) ? -1 : 0;
 }
 
          (((s_smpi_factor_t*)pa)->factor < ((s_smpi_factor_t*)pb)->factor) ? -1 : 0;
 }
 
-#include <surf/surfxml_parse.h> // FIXME: move that back to the parsing area
+#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
 static xbt_dynar_t parse_factor(const char *smpi_coef_string)
 {
   char *value = NULL;
 static xbt_dynar_t parse_factor(const char *smpi_coef_string)
 {
   char *value = NULL;
diff --git a/src/surf/platform.hpp b/src/surf/platform.hpp
deleted file mode 100644 (file)
index 9db38ba..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright (c) 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_PLATFORM_HPP
-#define SIMGRID_PLATFORM_HPP
-
-#include <xbt/base.h>
-#include <xbt/signal.hpp>
-#include <simgrid/forward.h>
-
-namespace simgrid {
-namespace surf {
-
-extern XBT_PRIVATE simgrid::xbt::signal<void(sg_platf_link_cbarg_t)> on_link;
-extern XBT_PRIVATE simgrid::xbt::signal<void(sg_platf_cluster_cbarg_t)> on_cluster;
-extern XBT_PRIVATE simgrid::xbt::signal<void(void)> on_postparse;
-
-}
-}
-
-#endif
index 7588146..8754117 100644 (file)
@@ -13,7 +13,6 @@
 #include "cpu_interface.hpp"
 #include "surf_routing.hpp"
 #include "xbt/lib.h"
 #include "cpu_interface.hpp"
 #include "surf_routing.hpp"
 #include "xbt/lib.h"
-#include "src/surf/platform.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_host);
 XBT_LOG_EXTERNAL_CATEGORY(xbt_cfg);
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_host);
 XBT_LOG_EXTERNAL_CATEGORY(xbt_cfg);
index 2c4dd11..a3ae7d8 100644 (file)
 #include "xbt/dict.h"
 #include "xbt/RngStream.h"
 #include <xbt/signal.hpp>
 #include "xbt/dict.h"
 #include "xbt/RngStream.h"
 #include <xbt/signal.hpp>
-#include "simgrid/platf_interface.h"
 #include "surf/surf.h"
 
 #include "src/simix/smx_private.h"
 #include "surf/surf.h"
 
 #include "src/simix/smx_private.h"
-#include "src/surf/platform.hpp"
 
 
-#include "surf/surfxml_parse.h"// FIXME: brain dead public header
+#include "src/include/simgrid/sg_config.h"
+#include "src/surf/xml/platf_private.hpp"
 
 
-#include "src/surf/platform.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/host_interface.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/host_interface.hpp"
 #include "src/surf/network_interface.hpp"
@@ -619,6 +617,75 @@ void sg_platf_end() {
   simgrid::surf::on_postparse();
 }
 
   simgrid::surf::on_postparse();
 }
 
+/* Pick the right models for CPU, net and host, and call their model_init_preparse */
+static void surf_config_models_setup()
+{
+  const char *host_model_name;
+  const char *vm_model_name;
+  int host_id = -1;
+  int vm_id = -1;
+  char *network_model_name = NULL;
+  char *cpu_model_name = NULL;
+  int storage_id = -1;
+  char *storage_model_name = NULL;
+
+  host_model_name = xbt_cfg_get_string(_sg_cfg_set, "host/model");
+  vm_model_name = xbt_cfg_get_string(_sg_cfg_set, "vm/model");
+  network_model_name = xbt_cfg_get_string(_sg_cfg_set, "network/model");
+  cpu_model_name = xbt_cfg_get_string(_sg_cfg_set, "cpu/model");
+  storage_model_name = xbt_cfg_get_string(_sg_cfg_set, "storage/model");
+
+  /* Check whether we use a net/cpu model differing from the default ones, in which case
+   * we should switch to the "compound" host model to correctly dispatch stuff to
+   * the right net/cpu models.
+   */
+
+  if ((!xbt_cfg_is_default_value(_sg_cfg_set, "network/model") ||
+       !xbt_cfg_is_default_value(_sg_cfg_set, "cpu/model")) &&
+      xbt_cfg_is_default_value(_sg_cfg_set, "host/model")) {
+    host_model_name = "compound";
+    xbt_cfg_set_string(_sg_cfg_set, "host/model", host_model_name);
+  }
+
+  XBT_DEBUG("host model: %s", host_model_name);
+  host_id = find_model_description(surf_host_model_description, host_model_name);
+  if (!strcmp(host_model_name, "compound")) {
+    int network_id = -1;
+    int cpu_id = -1;
+
+    xbt_assert(cpu_model_name,
+                "Set a cpu model to use with the 'compound' host model");
+
+    xbt_assert(network_model_name,
+                "Set a network model to use with the 'compound' host model");
+
+    if(surf_cpu_model_init_preparse){
+      surf_cpu_model_init_preparse();
+    } else {
+      cpu_id =
+          find_model_description(surf_cpu_model_description, cpu_model_name);
+      surf_cpu_model_description[cpu_id].model_init_preparse();
+    }
+
+    network_id =
+        find_model_description(surf_network_model_description,
+                               network_model_name);
+    surf_network_model_description[network_id].model_init_preparse();
+  }
+
+  XBT_DEBUG("Call host_model_init");
+  surf_host_model_description[host_id].model_init_preparse();
+
+  XBT_DEBUG("Call vm_model_init");
+  vm_id = find_model_description(surf_vm_model_description, vm_model_name);
+  surf_vm_model_description[vm_id].model_init_preparse();
+
+  XBT_DEBUG("Call storage_model_init");
+  storage_id = find_model_description(surf_storage_model_description, storage_model_name);
+  surf_storage_model_description[storage_id].model_init_preparse();
+
+}
+
 void sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS)
 {
   if (!surf_parse_models_setup_already_called) {
 void sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS)
 {
   if (!surf_parse_models_setup_already_called) {
index 208f552..31002dc 100644 (file)
@@ -80,7 +80,7 @@ StorageN11Model::~StorageN11Model(){
   storage_running_action_set_that_does_not_need_being_checked = NULL;
 }
 
   storage_running_action_set_that_does_not_need_being_checked = NULL;
 }
 
-#include <surf/surfxml_parse.h> // FIXME: move that back to the parsing area
+#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
 Storage *StorageN11Model::createStorage(const char* id, const char* type_id,
     const char* content_name, const char* content_type, xbt_dict_t properties,
     const char* attach)
 Storage *StorageN11Model::createStorage(const char* id, const char* type_id,
     const char* content_name, const char* content_type, xbt_dict_t properties,
     const char* attach)
index de6cfa5..2719ed6 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "xbt/lib.h"
 #include "surf/surf_routing.h"
 
 #include "xbt/lib.h"
 #include "surf/surf_routing.h"
-#include "simgrid/platf_interface.h"
 #include "surf/surf.h"
 #include "src/surf/surf_private.h"
 #include "src/internal_config.h"
 #include "surf/surf.h"
 #include "src/surf/surf_private.h"
 #include "src/internal_config.h"
index 1370cb1..2cf7e4c 100644 (file)
@@ -15,6 +15,7 @@
 #include "src/surf/trace_mgr.hpp"
 #include "src/instr/instr_private.h"
 #include "surf/surfxml_parse_values.h"
 #include "src/surf/trace_mgr.hpp"
 #include "src/instr/instr_private.h"
 #include "surf/surfxml_parse_values.h"
+#include "src/surf/xml/platf_private.hpp"
 
 #define NO_MAX_DURATION -1.0
 
 
 #define NO_MAX_DURATION -1.0
 
index 44f21cf..ef1c70a 100644 (file)
@@ -8,10 +8,8 @@
 #include "surf_routing_private.hpp"
 #include "surf_routing_cluster.hpp"
 
 #include "surf_routing_private.hpp"
 #include "surf_routing_cluster.hpp"
 
-#include "simgrid/platf_interface.h"    // platform creation API internal interface
 #include "simgrid/sg_config.h"
 #include "storage_interface.hpp"
 #include "simgrid/sg_config.h"
 #include "storage_interface.hpp"
-#include "src/surf/platform.hpp"
 #include "surf/surfxml_parse_values.h"
 
 #include "src/surf/surf_routing_cluster_torus.hpp"
 #include "surf/surfxml_parse_values.h"
 
 #include "src/surf/surf_routing_cluster_torus.hpp"
@@ -20,7 +18,7 @@
 #include "src/surf/surf_routing_floyd.hpp"
 #include "src/surf/surf_routing_full.hpp"
 #include "src/surf/surf_routing_vivaldi.hpp"
 #include "src/surf/surf_routing_floyd.hpp"
 #include "src/surf/surf_routing_full.hpp"
 #include "src/surf/surf_routing_vivaldi.hpp"
-#include <surf/surfxml_parse.h> // FIXME: move that back to the parsing area
+#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
 
 #include <vector>
 
 
 #include <vector>
 
index b4bb652..c5e1d63 100644 (file)
 
 #include <algorithm>
 
 
 #include <algorithm>
 
-#include <xbt/dict.h>
-#include <xbt/log.h>
-#include <xbt/sysdep.h>
-#include <xbt/dynar.h>
-#include <xbt/graph.h>
-
-#include "simgrid/platf_interface.h"    // platform creation API internal interface
+#include "xbt/dict.h"
+#include "xbt/log.h"
+#include "xbt/sysdep.h"
+#include "xbt/dynar.h"
+#include "xbt/graph.h"
 
 #include "surf_routing_private.hpp"
 #include "network_interface.hpp"
 
 #include "surf_routing_private.hpp"
 #include "network_interface.hpp"
index 9580c26..4e40b92 100644 (file)
@@ -16,7 +16,7 @@
 #include <fstream>
 #include <sstream>
 
 #include <fstream>
 #include <sstream>
 
-#include <surf/surfxml_parse.h> // FIXME: move that back to the parsing area
+#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_fat_tree, surf, "Routing for fat trees");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_fat_tree, surf, "Routing for fat trees");
index 60ccb73..5653259 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "src/surf/surf_routing_private.hpp"
 #include "src/surf/surf_routing_cluster_torus.hpp"
 
 #include "src/surf/surf_routing_private.hpp"
 #include "src/surf/surf_routing_cluster_torus.hpp"
-#include <surf/surfxml_parse.h> // FIXME: move that back to the parsing area
+#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster_torus, surf_route_cluster, "Torus Routing part of surf");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster_torus, surf_route_cluster, "Torus Routing part of surf");
 
index a53be9e..eb30182 100644 (file)
@@ -11,7 +11,6 @@
 #include "xbt/dynar.h"
 #include "surf/maxmin.h"
 #include "surf/datatypes.h"
 #include "xbt/dynar.h"
 #include "surf/maxmin.h"
 #include "surf/datatypes.h"
-#include "simgrid/platf_interface.h"
 #include "simgrid/forward.h"
 
 SG_BEGIN_DECL()
 #include "simgrid/forward.h"
 
 SG_BEGIN_DECL()
@@ -65,8 +64,6 @@ typedef struct tmgr_trace_iterator {
   int free_me;
 } s_tmgr_trace_event_t;
 
   int free_me;
 } s_tmgr_trace_event_t;
 
-XBT_PRIVATE double tmgr_event_generator_next_value(probabilist_event_generator_t generator);
-
 /* Creation functions */
 XBT_PUBLIC(tmgr_trace_t) tmgr_empty_trace_new(void);
 XBT_PUBLIC(void) tmgr_trace_free(tmgr_trace_t trace);
 /* Creation functions */
 XBT_PUBLIC(tmgr_trace_t) tmgr_empty_trace_new(void);
 XBT_PUBLIC(void) tmgr_trace_free(tmgr_trace_t trace);
similarity index 65%
rename from include/surf/surfxml_parse.h
rename to src/surf/xml/platf.hpp
index eca8e27..64e16dc 100644 (file)
@@ -7,18 +7,15 @@
 #ifndef _SURF_SURFXML_PARSE_H
 #define _SURF_SURFXML_PARSE_H
 
 #ifndef _SURF_SURFXML_PARSE_H
 #define _SURF_SURFXML_PARSE_H
 
-#include <stdio.h>              /* to have FILE */
 #include "xbt/misc.h"
 #include "xbt/function_types.h"
 #include "xbt/dict.h"
 
 SG_BEGIN_DECL()
 #include "xbt/misc.h"
 #include "xbt/function_types.h"
 #include "xbt/dict.h"
 
 SG_BEGIN_DECL()
-#include "surf/simgrid_dtd.h"
 
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
+/* Module management functions */
+XBT_PUBLIC(void) sg_platf_init(void);
+XBT_PUBLIC(void) sg_platf_exit(void);
 
 XBT_PUBLIC(void) surf_parse_open(const char *file);
 XBT_PUBLIC(void) surf_parse_close(void);
 
 XBT_PUBLIC(void) surf_parse_open(const char *file);
 XBT_PUBLIC(void) surf_parse_close(void);
@@ -33,20 +30,6 @@ XBT_PUBLIC(double) surf_parse_get_size(const char *string, const char *entity_ki
 XBT_PUBLIC(double) surf_parse_get_bandwidth(const char *string, const char *entity_kind, const char *name);
 XBT_PUBLIC(double) surf_parse_get_speed(const char *string, const char *entity_kind, const char *name);
 
 XBT_PUBLIC(double) surf_parse_get_bandwidth(const char *string, const char *entity_kind, const char *name);
 XBT_PUBLIC(double) surf_parse_get_speed(const char *string, const char *entity_kind, const char *name);
 
-/* Prototypes of the functions offered by flex */
-XBT_PUBLIC(int) surf_parse_lex(void);
-XBT_PUBLIC(int) surf_parse_get_lineno(void);
-XBT_PUBLIC(FILE *) surf_parse_get_in(void);
-XBT_PUBLIC(FILE *) surf_parse_get_out(void);
-XBT_PUBLIC(yy_size_t) surf_parse_get_leng(void);
-XBT_PUBLIC(char *) surf_parse_get_text(void);
-XBT_PUBLIC(void) surf_parse_set_lineno(int line_number);
-XBT_PUBLIC(void) surf_parse_set_in(FILE * in_str);
-XBT_PUBLIC(void) surf_parse_set_out(FILE * out_str);
-XBT_PUBLIC(int) surf_parse_get_debug(void);
-XBT_PUBLIC(void) surf_parse_set_debug(int bdebug);
-XBT_PUBLIC(int) surf_parse_lex_destroy(void);
-
 /* What is needed to bypass the parser. */
 XBT_PUBLIC_DATA(int_f_void_t) surf_parse;       /* Entry-point to the parser. Set this to your function. */
 
 /* What is needed to bypass the parser. */
 XBT_PUBLIC_DATA(int_f_void_t) surf_parse;       /* Entry-point to the parser. Set this to your function. */
 
similarity index 86%
rename from include/simgrid/platf.h
rename to src/surf/xml/platf_private.hpp
index 401864e..b505dc9 100644 (file)
@@ -1,4 +1,4 @@
-/* platf.h - Public interface to the SimGrid platforms                      */
+/* platf_private.h - Interface to the SimGrid platforms which visibility should be limited to this directory */
 
 /* Copyright (c) 2004-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* Copyright (c) 2004-2015. The SimGrid Team.
  * All rights reserved.                                                     */
@@ -9,11 +9,16 @@
 #ifndef SG_PLATF_H
 #define SG_PLATF_H
 
 #ifndef SG_PLATF_H
 #define SG_PLATF_H
 
-#include <xbt.h>
-#include <simgrid/host.h>
-#include "forward.h"
+#include "simgrid/host.h"
+#include "src/surf/xml/platf.hpp"
 
 SG_BEGIN_DECL()
 
 SG_BEGIN_DECL()
+#include "src/surf/xml/simgrid_dtd.h"
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
 
 static inline char* sg_storage_name(sg_storage_t storage) {
   return storage->key;
 
 static inline char* sg_storage_name(sg_storage_t storage) {
   return storage->key;
@@ -251,6 +256,11 @@ typedef struct s_sg_platf_AS_cbarg {
 /** opaque structure defining a event generator for availability based on a probability distribution */
 typedef struct probabilist_event_generator *probabilist_event_generator_t;
 
 /** opaque structure defining a event generator for availability based on a probability distribution */
 typedef struct probabilist_event_generator *probabilist_event_generator_t;
 
+/********** Routing **********/
+void routing_AS_begin(sg_platf_AS_cbarg_t AS);
+void routing_AS_end(void);
+void routing_cluster_add_backbone(Link* bb);
+surf_As* routing_get_current();
 /*** END of the parsing cruft ***/
 
 XBT_PUBLIC(void) sg_platf_begin(void);  // Start a new platform
 /*** END of the parsing cruft ***/
 
 XBT_PUBLIC(void) sg_platf_begin(void);  // Start a new platform
@@ -279,6 +289,31 @@ XBT_PUBLIC(void) sg_platf_new_mount(sg_platf_mount_cbarg_t mount);
 
 XBT_PUBLIC(void) sg_platf_new_process(sg_platf_process_cbarg_t process);
 
 
 XBT_PUBLIC(void) sg_platf_new_process(sg_platf_process_cbarg_t process);
 
+/* Prototypes of the functions offered by flex */
+XBT_PUBLIC(int) surf_parse_lex(void);
+XBT_PUBLIC(int) surf_parse_get_lineno(void);
+XBT_PUBLIC(FILE *) surf_parse_get_in(void);
+XBT_PUBLIC(FILE *) surf_parse_get_out(void);
+XBT_PUBLIC(yy_size_t) surf_parse_get_leng(void);
+XBT_PUBLIC(char *) surf_parse_get_text(void);
+XBT_PUBLIC(void) surf_parse_set_lineno(int line_number);
+XBT_PUBLIC(void) surf_parse_set_in(FILE * in_str);
+XBT_PUBLIC(void) surf_parse_set_out(FILE * out_str);
+XBT_PUBLIC(int) surf_parse_get_debug(void);
+XBT_PUBLIC(void) surf_parse_set_debug(int bdebug);
+XBT_PUBLIC(int) surf_parse_lex_destroy(void);
+
+
 SG_END_DECL()
 
 SG_END_DECL()
 
+namespace simgrid {
+namespace surf {
+
+extern XBT_PRIVATE simgrid::xbt::signal<void(sg_platf_link_cbarg_t)> on_link;
+extern XBT_PRIVATE simgrid::xbt::signal<void(sg_platf_cluster_cbarg_t)> on_cluster;
+extern XBT_PRIVATE simgrid::xbt::signal<void(void)> on_postparse;
+
+}
+}
+
 #endif                          /* SG_PLATF_H */
 #endif                          /* SG_PLATF_H */
similarity index 99%
rename from src/surf/simgrid_dtd.c
rename to src/surf/xml/simgrid_dtd.c
index 512ea0b..c8b3eee 100644 (file)
@@ -1,5 +1,5 @@
 
 
-#line 3 "src/surf/simgrid_dtd.c"
+#line 3 "src/surf/xml/simgrid_dtd.c"
 
 #define  YY_INT_ALIGNED short int
 
 
 #define  YY_INT_ALIGNED short int
 
@@ -4547,7 +4547,7 @@ int surf_parse__flex_debug = 0;
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
 char *surf_parse_text;
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
 char *surf_parse_text;
-/* Validating XML processor for src/surf/simgrid.dtd.
+/* Validating XML processor for src/surf/xml/simgrid.dtd.
  *
  * This program was generated with the FleXML XML processor generator.
  * FleXML is Copyright (C) 1999-2005 Kristoffer Rose.  All rights reserved.
  *
  * This program was generated with the FleXML XML processor generator.
  * FleXML is Copyright (C) 1999-2005 Kristoffer Rose.  All rights reserved.
@@ -6037,8 +6037,8 @@ YY_RULE_SETUP
   if (!AX_surfxml_ASroute_src) FAIL("Required attribute `src' not set for `ASroute' element.");
   LEAVE; STag_surfxml_ASroute(); surfxml_pcdata_ix = 0; ETag_surfxml_ASroute(); popbuffer(); /* attribute */
   switch (YY_START) {
   if (!AX_surfxml_ASroute_src) FAIL("Required attribute `src' not set for `ASroute' element.");
   LEAVE; STag_surfxml_ASroute(); surfxml_pcdata_ix = 0; ETag_surfxml_ASroute(); popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS_3: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break;
-   case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
+   case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
   }
  }
        YY_BREAK
   }
  }
        YY_BREAK
@@ -6062,8 +6062,8 @@ YY_RULE_SETUP
   ETag_surfxml_ASroute();
   popbuffer(); /* attribute */
   switch (YY_START) {
   ETag_surfxml_ASroute();
   popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS_3: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break;
-   case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
+   case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_1: case S_surfxml_AS_4: case S_surfxml_AS_7: case S_surfxml_AS_8: SET(S_surfxml_AS_8); break;
   }
  }
        YY_BREAK
   }
  }
        YY_BREAK
similarity index 99%
rename from include/surf/simgrid_dtd.h
rename to src/surf/xml/simgrid_dtd.h
index cccbbdb..58a929e 100644 (file)
@@ -1,4 +1,4 @@
-/* XML processor/application API for src/surf/simgrid.dtd.
+/* XML processor/application API for src/surf/xml/simgrid.dtd.
  *
  * This program was generated with the FleXML XML processor generator.
  * FleXML is Copyright (C) 1999-2005 Kristoffer Rose.  All rights reserved.
  *
  * This program was generated with the FleXML XML processor generator.
  * FleXML is Copyright (C) 1999-2005 Kristoffer Rose.  All rights reserved.
similarity index 99%
rename from src/surf/surfxml_parseplatf.cpp
rename to src/surf/xml/surfxml_parseplatf.cpp
index f805865..0c85993 100644 (file)
@@ -8,11 +8,10 @@
 #include "xbt/log.h"
 #include "xbt/str.h"
 #include "xbt/dict.h"
 #include "xbt/log.h"
 #include "xbt/str.h"
 #include "xbt/dict.h"
-#include "simgrid/platf.h"
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/network_interface.hpp"
 
 #include "src/surf/cpu_interface.hpp"
 #include "src/surf/network_interface.hpp"
 
-#include <surf/surfxml_parse.h>
+#include "src/surf/xml/platf.hpp"
 
 #ifdef HAVE_LUA
 extern "C" {
 
 #ifdef HAVE_LUA
 extern "C" {
similarity index 99%
rename from src/surf/surfxml_parse.cpp
rename to src/surf/xml/surfxml_sax_cb.cpp
index 5e0aab1..b36b0e2 100644 (file)
@@ -16,7 +16,7 @@
 #include "src/surf/surf_private.h"
 #include "simgrid/sg_config.h"
 
 #include "src/surf/surf_private.h"
 #include "simgrid/sg_config.h"
 
-#include <surf/surfxml_parse.h>
+#include "src/surf/xml/platf_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf,
                                 "Logging specific to the SURF parsing module");
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf,
                                 "Logging specific to the SURF parsing module");
index 342c9cd..1f24711 100644 (file)
@@ -6,7 +6,6 @@
 /* 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. */
 
 /* 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/platf.h"
 #include "simgrid/simix.h"
 #include "xbt/log.h"
 
 #include "simgrid/simix.h"
 #include "xbt/log.h"
 
@@ -31,11 +30,11 @@ static int master(int argc, char *argv[])
 {
   XBT_INFO("Launching our nice bugged recursive function...");
   unsigned i = 1;
 {
   XBT_INFO("Launching our nice bugged recursive function...");
   unsigned i = 1;
-  do {
+  while (i <= 0x80000000u) {
     i *= 2;
     unsigned res = collatz(i, i);
     XBT_VERB("collatz(%u, %u) returned %u", i, i, res);
     i *= 2;
     unsigned res = collatz(i, i);
     XBT_VERB("collatz(%u, %u) returned %u", i, i, res);
-  } while (i <= 0x80000000u);
+  }
   return 0;
 }
 
   return 0;
 }
 
@@ -43,10 +42,7 @@ int main(int argc, char *argv[])
 {
   SIMIX_global_init(&argc, argv);
 
 {
   SIMIX_global_init(&argc, argv);
 
-  if (argc != 3) {
-    printf("Usage: %s platform.xml deployment.xml\n", argv[0]);
-    exit(EXIT_FAILURE);
-  }
+  xbt_assert(argc == 3, "Usage: %s platform.xml deployment.xml\n", argv[0]);
 
   SIMIX_function_register("master", master);
   SIMIX_create_environment(argv[1]);
 
   SIMIX_function_register("master", master);
   SIMIX_create_environment(argv[1]);
index 8aa09ec..37a90b4 100644 (file)
@@ -9,7 +9,6 @@
 #include <stdio.h>
 #include "simgrid/sg_config.h"
 #include "surf/surf.h"
 #include <stdio.h>
 #include "simgrid/sg_config.h"
 #include "surf/surf.h"
-#include "surf/surfxml_parse.h" // for reset callback
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/cpu_interface.hpp"
 
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/cpu_interface.hpp"
 
index 41024bc..3230aa2 100644 (file)
@@ -9,7 +9,6 @@
 #include <stdio.h>
 #include "simgrid/sg_config.h"
 #include "surf/surf.h"
 #include <stdio.h>
 #include "simgrid/sg_config.h"
 #include "surf/surf.h"
-#include "surf/surfxml_parse.h" // for reset callback
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/cpu_interface.hpp"
 
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/cpu_interface.hpp"
 
index cc3b711..04fabde 100644 (file)
@@ -8,7 +8,6 @@ set(EXTRA_DIST
   src/mc/mc_mmu.h
   src/mc/PageStore.hpp
   src/mc/mc_record.h
   src/mc/mc_mmu.h
   src/mc/PageStore.hpp
   src/mc/mc_record.h
-  src/include/simgrid/platf_interface.h
   src/include/simgrid/sg_config.h
   src/include/smpi/smpi_interface.h
   src/include/surf/datatypes.h
   src/include/simgrid/sg_config.h
   src/include/smpi/smpi_interface.h
   src/include/surf/datatypes.h
@@ -60,10 +59,11 @@ set(EXTRA_DIST
   src/surf/ns3/ns3_interface.h
   src/surf/ns3/ns3_simulator.h
   src/surf/ns3/red-queue.h
   src/surf/ns3/ns3_interface.h
   src/surf/ns3/ns3_simulator.h
   src/surf/ns3/red-queue.h
-  src/surf/platform.hpp
   src/surf/plugins/energy.hpp
   src/surf/plugins/energy.hpp
-  src/surf/simgrid.dtd
-  src/surf/simgrid_dtd.c
+  src/surf/xml/simgrid.dtd
+  src/surf/xml/simgrid_dtd.h
+  src/surf/xml/simgrid_dtd.c
+  src/surf/xml/surfxml_sax_cb.cpp
   src/surf/storage_interface.hpp
   src/surf/storage_n11.hpp
   src/surf/surf_interface.hpp
   src/surf/storage_interface.hpp
   src/surf/storage_n11.hpp
   src/surf/surf_interface.hpp
@@ -79,7 +79,6 @@ set(EXTRA_DIST
   src/surf/surf_routing_none.hpp
   src/surf/surf_routing_private.hpp
   src/surf/surf_routing_vivaldi.hpp
   src/surf/surf_routing_none.hpp
   src/surf/surf_routing_private.hpp
   src/surf/surf_routing_vivaldi.hpp
-  src/surf/surfxml_parse.cpp
   src/surf/vm_hl13.hpp
   src/surf/PropertyHolder.hpp
   src/surf/virtual_machine.hpp
   src/surf/vm_hl13.hpp
   src/surf/PropertyHolder.hpp
   src/surf/virtual_machine.hpp
@@ -336,8 +335,10 @@ set(SURF_SRC
   src/surf/surf_routing_RoutedGraph.cpp
   src/surf/surf_routing_none.cpp
   src/surf/surf_routing_vivaldi.cpp
   src/surf/surf_routing_RoutedGraph.cpp
   src/surf/surf_routing_none.cpp
   src/surf/surf_routing_vivaldi.cpp
-  src/surf/surfxml_parse.cpp
-  src/surf/surfxml_parseplatf.cpp
+  src/surf/xml/platf.hpp
+  src/surf/xml/platf_private.hpp
+  src/surf/xml/surfxml_sax_cb.cpp
+  src/surf/xml/surfxml_parseplatf.cpp
   src/surf/trace_mgr.hpp
   src/surf/trace_mgr.cpp
   src/surf/vm_hl13.cpp
   src/surf/trace_mgr.hpp
   src/surf/trace_mgr.cpp
   src/surf/vm_hl13.cpp
@@ -653,7 +654,6 @@ set(headers_to_install
   include/simgrid/datatypes.h
   include/simgrid/modelchecker.h
   include/simgrid/forward.h
   include/simgrid/datatypes.h
   include/simgrid/modelchecker.h
   include/simgrid/forward.h
-  include/simgrid/platf.h
   include/simgrid/simix.h
   include/simgrid/simix.hpp
   include/simgrid/host.h
   include/simgrid/simix.h
   include/simgrid/simix.hpp
   include/simgrid/host.h
@@ -672,9 +672,7 @@ set(headers_to_install
   include/smpi/mpi.h
   include/smpi/smpi.h
   include/smpi/smpi_main.h
   include/smpi/mpi.h
   include/smpi/smpi.h
   include/smpi/smpi_main.h
-  include/surf/simgrid_dtd.h
   include/surf/surf_routing.h
   include/surf/surf_routing.h
-  include/surf/surfxml_parse.h
   include/xbt.h
   include/xbt/RngStream.h
   include/xbt/asserts.h
   include/xbt.h
   include/xbt/RngStream.h
   include/xbt/asserts.h
index a9b915b..175d693 100644 (file)
@@ -108,7 +108,7 @@ add_custom_target(sync-gforge-doc
   COMMAND ${RSYNC_CMD} doc/html/simgrid_modules2.png doc/html/simgrid_modules.png doc/webcruft/simgrid_logo_2011.png
   doc/webcruft/simgrid_logo_2011_small.png scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid/${release_version}/
 
   COMMAND ${RSYNC_CMD} doc/html/simgrid_modules2.png doc/html/simgrid_modules.png doc/webcruft/simgrid_logo_2011.png
   doc/webcruft/simgrid_logo_2011_small.png scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid/${release_version}/
 
-  COMMAND ${RSYNC_CMD} src/surf/simgrid.dtd scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid/
+  COMMAND ${RSYNC_CMD} src/surf/xml/simgrid.dtd scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid/
 
   WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
   )
 
   WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}"
   )
index 712696c..9ba2824 100644 (file)
@@ -144,40 +144,41 @@ if(enable_maintainer_mode AND NOT WIN32)
     set(string15 "'s/FAIL(\"Premature EOF/if(!ETag_surfxml_include_state()) FAIL(\"Premature EOF/'")
 
     ADD_CUSTOM_COMMAND(
     set(string15 "'s/FAIL(\"Premature EOF/if(!ETag_surfxml_include_state()) FAIL(\"Premature EOF/'")
 
     ADD_CUSTOM_COMMAND(
-      OUTPUT   ${CMAKE_HOME_DIRECTORY}/include/surf/simgrid_dtd.h
+      OUTPUT   ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.h
       ${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h
       ${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h
-      ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.c
+      ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.c
       ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
 
       ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
 
-      DEPENDS  ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd
+      DEPENDS  ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid.dtd
       ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.dtd
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd
 
       ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.dtd
       ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd
 
-      #${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd
-      COMMAND ${FLEXML_EXE} --root-tags platform -b 1000000 -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd -S src/surf/simgrid_dtd.l -L src/surf/simgrid.dtd
-      COMMAND ${SED_EXE} -i ${string14} src/surf/simgrid_dtd.l
-      COMMAND ${CMAKE_COMMAND} -E echo "src/surf/simgrid_dtd.l"
+      #${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid.dtd
+      COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/src/surf/xml
+      COMMAND ${FLEXML_EXE} --root-tags platform -b 1000000 -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd -S src/surf/xml/simgrid_dtd.l -L src/surf/xml/simgrid.dtd
+      COMMAND ${SED_EXE} -i ${string14} src/surf/xml/simgrid_dtd.l
+      COMMAND ${CMAKE_COMMAND} -E echo "       Generated src/surf/xml/simgrid_dtd.l"
 
       #${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.l: ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.dtd
       COMMAND ${FLEXML_EXE} -b 1000000 -P graphxml --sysid=graphxml.dtd -S src/xbt/graphxml.l -L src/xbt/graphxml.dtd
       COMMAND ${SED_EXE} -i ${string14} src/xbt/graphxml.l
 
       #${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.l: ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.dtd
       COMMAND ${FLEXML_EXE} -b 1000000 -P graphxml --sysid=graphxml.dtd -S src/xbt/graphxml.l -L src/xbt/graphxml.dtd
       COMMAND ${SED_EXE} -i ${string14} src/xbt/graphxml.l
-      COMMAND ${CMAKE_COMMAND} -E echo "src/xbt/graphxml.l"
+      COMMAND ${CMAKE_COMMAND} -E echo "       Generated src/xbt/graphxml.l"
 
       #${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd
       COMMAND ${FLEXML_EXE} -b 1000000 --root-tags adag -P dax_ --sysid=dax.dtd -S src/simdag/dax_dtd.l -L src/simdag/dax.dtd
       COMMAND ${SED_EXE} -i ${string5} src/simdag/dax_dtd.l
       COMMAND ${SED_EXE} -i ${string14} src/simdag/dax_dtd.l
 
       #${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd
       COMMAND ${FLEXML_EXE} -b 1000000 --root-tags adag -P dax_ --sysid=dax.dtd -S src/simdag/dax_dtd.l -L src/simdag/dax.dtd
       COMMAND ${SED_EXE} -i ${string5} src/simdag/dax_dtd.l
       COMMAND ${SED_EXE} -i ${string14} src/simdag/dax_dtd.l
-      COMMAND ${CMAKE_COMMAND} -E echo "src/simdag/dax_dtd.l"
+      COMMAND ${CMAKE_COMMAND} -E echo "       Generated src/simdag/dax_dtd.l"
 
 
-      #${CMAKE_HOME_DIRECTORY}/include/surf/simgrid_dtd.h: ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd
+      #${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.h: ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid.dtd
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/include/surf/simgrid.h
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/include/surf/simgrid.h
-      COMMAND ${FLEXML_EXE} --root-tags platform -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd -H include/surf/simgrid_dtd.h -L src/surf/simgrid.dtd
-      COMMAND ${SED_EXE} -i ${string1} include/surf/simgrid_dtd.h
-      COMMAND ${SED_EXE} -i ${string2} include/surf/simgrid_dtd.h
-      COMMAND ${SED_EXE} -i ${string14} include/surf/simgrid_dtd.h
-      COMMAND ${CMAKE_COMMAND} -E echo "include/surf/simgrid_dtd.h"
+      COMMAND ${FLEXML_EXE} --root-tags platform -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd -H src/surf/xml/simgrid_dtd.h -L src/surf/xml/simgrid.dtd
+      COMMAND ${SED_EXE} -i ${string1} src/surf/xml/simgrid_dtd.h
+      COMMAND ${SED_EXE} -i ${string2} src/surf/xml/simgrid_dtd.h
+      COMMAND ${SED_EXE} -i ${string14} src/surf/xml/simgrid_dtd.h
+      COMMAND ${CMAKE_COMMAND} -E echo "       Generated src/surf/xml/simgrid_dtd.h"
 
       #${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h: ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.dtd
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h
 
       #${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h: ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.dtd
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h
@@ -185,7 +186,7 @@ if(enable_maintainer_mode AND NOT WIN32)
       COMMAND ${SED_EXE} -i ${string1} include/xbt/graphxml.h
       COMMAND ${SED_EXE} -i ${string2} include/xbt/graphxml.h
       COMMAND ${SED_EXE} -i ${string14} include/xbt/graphxml.h
       COMMAND ${SED_EXE} -i ${string1} include/xbt/graphxml.h
       COMMAND ${SED_EXE} -i ${string2} include/xbt/graphxml.h
       COMMAND ${SED_EXE} -i ${string14} include/xbt/graphxml.h
-      COMMAND ${CMAKE_COMMAND} -E echo "include/xbt/graphxml.h"
+      COMMAND ${CMAKE_COMMAND} -E echo "       Generated include/xbt/graphxml.h"
 
       #${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h: ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h
 
       #${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h: ${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h
@@ -193,18 +194,17 @@ if(enable_maintainer_mode AND NOT WIN32)
       COMMAND ${SED_EXE} -i ${string1} src/simdag/dax_dtd.h
       COMMAND ${SED_EXE} -i ${string2} src/simdag/dax_dtd.h
       COMMAND ${SED_EXE} -i ${string14} src/simdag/dax_dtd.h
       COMMAND ${SED_EXE} -i ${string1} src/simdag/dax_dtd.h
       COMMAND ${SED_EXE} -i ${string2} src/simdag/dax_dtd.h
       COMMAND ${SED_EXE} -i ${string14} src/simdag/dax_dtd.h
-      COMMAND ${CMAKE_COMMAND} -E echo "src/simdag/dax_dtd.h"
-
-      #surf/simgrid_dtd.c: surf/simgrid_dtd.l
-      COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.c
-      COMMAND ${SED_EXE} -i ${string8} src/surf/simgrid_dtd.l
-      COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_HOME_DIRECTORY}/src/surf
-      COMMAND ${FLEX_EXE} -o src/surf/simgrid_dtd.c -Psurf_parse_ --noline src/surf/simgrid_dtd.l
-      COMMAND ${SED_EXE} -i ${string9} src/surf/simgrid_dtd.c
-      COMMAND ${SED_EXE} -i ${string15} src/surf/simgrid_dtd.c
-      COMMAND ${SED_EXE} -i 's/int yyl\;/unsigned int yyl\;/' src/surf/simgrid_dtd.c
-      COMMAND ${SED_EXE} -i "s/register //" src/surf/simgrid_dtd.c
-      COMMAND ${CMAKE_COMMAND} -E echo "surf/simgrid_dtd.c"
+      COMMAND ${CMAKE_COMMAND} -E echo "       Generated src/simdag/dax_dtd.h"
+
+      #surf/xml/simgrid_dtd.c: surf/xml/simgrid_dtd.l
+      COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.c
+      COMMAND ${SED_EXE} -i ${string8} src/surf/xml/simgrid_dtd.l
+      COMMAND ${FLEX_EXE} -o src/surf/xml/simgrid_dtd.c -Psurf_parse_ --noline src/surf/xml/simgrid_dtd.l
+      COMMAND ${SED_EXE} -i ${string9} src/surf/xml/simgrid_dtd.c
+      COMMAND ${SED_EXE} -i ${string15} src/surf/xml/simgrid_dtd.c
+      COMMAND ${SED_EXE} -i 's/int yyl\;/unsigned int yyl\;/' src/surf/xml/simgrid_dtd.c
+      COMMAND ${SED_EXE} -i "s/register //" src/surf/xml/simgrid_dtd.c
+      COMMAND ${CMAKE_COMMAND} -E echo "       Generated surf/xml/simgrid_dtd.c"
 
       #xbt/graphxml.c: xbt/graphxml.l
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c
 
       #xbt/graphxml.c: xbt/graphxml.l
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c
@@ -214,7 +214,7 @@ if(enable_maintainer_mode AND NOT WIN32)
       COMMAND ${SED_EXE} -i ${string9} src/xbt/graphxml.c
       COMMAND ${SED_EXE} -i 's/int yyl\;/unsigned int yyl\;/' src/xbt/graphxml.c
       COMMAND ${SED_EXE} -i "s/register //" src/xbt/graphxml.c
       COMMAND ${SED_EXE} -i ${string9} src/xbt/graphxml.c
       COMMAND ${SED_EXE} -i 's/int yyl\;/unsigned int yyl\;/' src/xbt/graphxml.c
       COMMAND ${SED_EXE} -i "s/register //" src/xbt/graphxml.c
-      COMMAND ${CMAKE_COMMAND} -E echo "xbt/graphxml.c"
+      COMMAND ${CMAKE_COMMAND} -E echo "       Generated xbt/graphxml.c"
 
       #simdag/dax_dtd.c: simdag/dax_dtd.l
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
 
       #simdag/dax_dtd.c: simdag/dax_dtd.l
       COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
@@ -223,7 +223,7 @@ if(enable_maintainer_mode AND NOT WIN32)
       COMMAND ${FLEX_EXE} -o src/simdag/dax_dtd.c -Pdax_ --noline src/simdag/dax_dtd.l
       COMMAND ${SED_EXE} -i ${string9}                        src/simdag/dax_dtd.c
       COMMAND ${SED_EXE} -i 's/int yyl\;/unsigned int yyl\;/' src/simdag/dax_dtd.c
       COMMAND ${FLEX_EXE} -o src/simdag/dax_dtd.c -Pdax_ --noline src/simdag/dax_dtd.l
       COMMAND ${SED_EXE} -i ${string9}                        src/simdag/dax_dtd.c
       COMMAND ${SED_EXE} -i 's/int yyl\;/unsigned int yyl\;/' src/simdag/dax_dtd.c
-      COMMAND ${CMAKE_COMMAND} -E echo "src/simdag/dax_dtd.c"
+      COMMAND ${CMAKE_COMMAND} -E echo "       Generated src/simdag/dax_dtd.c"
 
       WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}
       COMMENT "Generating files in maintainer mode..."
 
       WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}
       COMMENT "Generating files in maintainer mode..."
@@ -246,10 +246,10 @@ if(enable_maintainer_mode AND NOT WIN32)
 endif()
 
     add_custom_target(maintainer_files
 endif()
 
     add_custom_target(maintainer_files
-      DEPENDS ${CMAKE_HOME_DIRECTORY}/include/surf/simgrid_dtd.h
-      ${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h
-      ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h
-      ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.c
-      ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c
-      ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
+      DEPENDS ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.h
+              ${CMAKE_HOME_DIRECTORY}/src/surf/xml/simgrid_dtd.c
+              ${CMAKE_HOME_DIRECTORY}/include/xbt/graphxml.h
+              ${CMAKE_HOME_DIRECTORY}/src/xbt/graphxml.c
+              ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.h
+              ${CMAKE_HOME_DIRECTORY}/src/simdag/dax_dtd.c
       )
       )