Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further parser cleanups
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 8 Nov 2011 14:06:44 +0000 (15:06 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 8 Nov 2011 14:06:44 +0000 (15:06 +0100)
- kill some dead code related to the old lua console
- do not load a header at the *end* of another header
- solve some header inclusion madness created in this process

20 files changed:
include/simgrid/platf.h
src/include/surf/surf.h
src/include/surf/surf_resource_lmm.h
src/include/surf/trace_mgr.h
src/simdag/sd_link.c
src/simdag/sd_workstation.c
src/smpi/smpi_bench.c
src/surf/cpu.c
src/surf/cpu_im.c
src/surf/cpu_ti.c
src/surf/network.c
src/surf/network_im.c
src/surf/surf.c
src/surf/surf_private.h
src/surf/surf_routing.c
src/surf/surfxml_parse.c
src/surf/workstation.c
src/surf/workstation_ptask_L07.c
testsuite/surf/surf_usage.c
testsuite/surf/surf_usage2.c

index 8de4bd2..e17d1b2 100644 (file)
 #include <xbt.h>
 
 typedef struct tmgr_trace *tmgr_trace_t; /**< Opaque structure defining an availability trace */
 #include <xbt.h>
 
 typedef struct tmgr_trace *tmgr_trace_t; /**< Opaque structure defining an availability trace */
+XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new(const char *filename);
+XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_string(const char *id,
+                                                    const char *input,
+                                                    double periodicity);
 
 /** Defines whether a given resource is working or not */
 typedef enum {
 
 /** Defines whether a given resource is working or not */
 typedef enum {
index cafb3d3..3d38e2a 100644 (file)
@@ -703,96 +703,5 @@ XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_latency;
 
 XBT_PUBLIC(double) get_cpu_power(const char *power);
 
 
 XBT_PUBLIC(double) get_cpu_power(const char *power);
 
-/*public interface to create resource bypassing the parser via cpu/network model
- *
- * see surfxml_parse.c
- * */
-XBT_PUBLIC(void*) surf_host_create_resource(char *name, double power_peak,
-                                           double power_scale,
-                                           tmgr_trace_t power_trace,
-                                           int core,
-                                           e_surf_resource_state_t
-                                           state_initial,
-                                           tmgr_trace_t state_trace,
-                                           xbt_dict_t cpu_properties);
-
-/*public interface to create resource bypassing the parser via workstation_ptask_L07 model
- *
- * see surfxml_parse.c
- * */
-XBT_PUBLIC(void*) surf_wsL07_host_create_resource(char *name,
-                                                 double power_peak,
-                                                 double power_scale,
-                                                 tmgr_trace_t power_trace,
-                                                 e_surf_resource_state_t
-                                                 state_initial,
-                                                 tmgr_trace_t state_trace,
-                                                 xbt_dict_t
-                                                 cpu_properties);
-/**
- * create link resource
- * see surfxml_parse.c
- */
-XBT_PUBLIC(void*) surf_link_create_resource(char *name,
-                                           double bw_initial,
-                                           tmgr_trace_t bw_trace,
-                                           double lat_initial,
-                                           tmgr_trace_t lat_trace,
-                                           e_surf_resource_state_t
-                                           state_initial,
-                                           tmgr_trace_t state_trace,
-                                           e_surf_link_sharing_policy_t
-                                           policy, xbt_dict_t properties);
-
-
-XBT_PUBLIC(void*) surf_wsL07_link_create_resource(char *name,
-                                                 double bw_initial,
-                                                 tmgr_trace_t bw_trace,
-                                                 double lat_initial,
-                                                 tmgr_trace_t lat_trace,
-                                                 e_surf_resource_state_t
-                                                 state_initial,
-                                                 tmgr_trace_t state_trace,
-                                                 e_surf_link_sharing_policy_t
-                                                 policy,
-                                                 xbt_dict_t properties);
-/**
- * add route element (link_ctn) bypassing the parser
- *
- * see surfxml_parse.c
- *
- */
-XBT_PUBLIC(void) surf_add_route_element(char *link_ctn_id);
-
-/**
- * set route src_id,dest_id, and create a route resource
- *
- * see surf_routing.c && surfxml_parse.c
- */
-
-XBT_PUBLIC(void) surf_set_routes(void);
-
-
-/**
- * add traces
- * see surfxml_parse.c
- */
-XBT_PUBLIC(void) surf_add_host_traces(void);
-XBT_PUBLIC(void) surf_add_link_traces(void);
-XBT_PUBLIC(void) surf_wsL07_add_traces(void);
-
-//Set a new link on the actual list of link for a route or ASroute
-XBT_PUBLIC(void) routing_add_link(const char *link_id);
-//Set the endpoints for a route
-XBT_PUBLIC(void) routing_set_route(const char *src_id, const char *dst_id);
-//Store the route
-XBT_PUBLIC(void) routing_store_route(void);
-XBT_PUBLIC(void) surf_routing_add_route(const char *src_id,
-                                        const char *dest_id,
-                                        xbt_dynar_t links_id);
-
-#include "surf/surf_resource.h"
-#include "surf/surf_resource_lmm.h"
-
 SG_END_DECL()
 #endif                          /* _SURF_SURF_H */
 SG_END_DECL()
 #endif                          /* _SURF_SURF_H */
index e1c3a0b..4f7eb94 100644 (file)
@@ -9,6 +9,8 @@
 #define SURF_RESOURCE_LMM_H
 #include "surf/surf.h"
 #include "surf/trace_mgr.h"
 #define SURF_RESOURCE_LMM_H
 #include "surf/surf.h"
 #include "surf/trace_mgr.h"
+#include "surf/surf_resource.h"
+
 
 static XBT_INLINE
     surf_resource_lmm_t surf_resource_lmm_new(size_t childsize,
 
 static XBT_INLINE
     surf_resource_lmm_t surf_resource_lmm_new(size_t childsize,
index 394cddc..0ea8271 100644 (file)
 XBT_PUBLIC(tmgr_history_t) tmgr_history_new(void);
 XBT_PUBLIC(void) tmgr_history_free(tmgr_history_t history);
 
 XBT_PUBLIC(tmgr_history_t) tmgr_history_new(void);
 XBT_PUBLIC(void) tmgr_history_free(tmgr_history_t history);
 
-XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new(const char *filename);
-XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_string(const char *id,
-                                                    const char *input,
-                                                    double periodicity);
 XBT_PUBLIC(tmgr_trace_t) tmgr_empty_trace_new(void);
 XBT_INLINE XBT_PUBLIC(void) tmgr_trace_free(tmgr_trace_t trace);
 /**
 XBT_PUBLIC(tmgr_trace_t) tmgr_empty_trace_new(void);
 XBT_INLINE XBT_PUBLIC(void) tmgr_trace_free(tmgr_trace_t trace);
 /**
index f3a3750..5308684 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2011. 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,6 +9,8 @@
 #include "xbt/dict.h"
 #include "xbt/sysdep.h"
 #include "surf/surf.h"
 #include "xbt/dict.h"
 #include "xbt/sysdep.h"
 #include "surf/surf.h"
+#include "surf/surf_resource.h"
+
 
 /* Creates a link and registers it in SD.
  */
 
 /* Creates a link and registers it in SD.
  */
index 232b83c..938e223 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2011. 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,6 +9,9 @@
 #include "xbt/dict.h"
 #include "xbt/sysdep.h"
 #include "surf/surf.h"
 #include "xbt/dict.h"
 #include "xbt/sysdep.h"
 #include "surf/surf.h"
+#include "surf/surf_resource.h"
+
+
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_workstation, sd,
                                 "Logging specific to SimDag (workstation)");
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_workstation, sd,
                                 "Logging specific to SimDag (workstation)");
index c9d2c8b..5a0e491 100644 (file)
@@ -4,6 +4,7 @@
 /* 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 <math.h> // sqrt
 #include "private.h"
 #include "xbt/dict.h"
 #include "xbt/sysdep.h"
 #include "private.h"
 #include "xbt/dict.h"
 #include "xbt/sysdep.h"
index 3106dbf..f7ba2ce 100644 (file)
@@ -1,10 +1,12 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2011. 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. */
 
 #include "surf_private.h"
  * 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. */
 
 #include "surf_private.h"
+#include "surf/surf_resource.h"
+
 
 typedef s_surf_action_lmm_t s_surf_action_cpu_Cas01_t,
     *surf_action_cpu_Cas01_t;
 
 typedef s_surf_action_lmm_t s_surf_action_cpu_Cas01_t,
     *surf_action_cpu_Cas01_t;
index 6adc2bc..eec52e0 100644 (file)
@@ -1,10 +1,12 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2011. 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. */
 
 #include "surf_private.h"
  * 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. */
 
 #include "surf_private.h"
+#include "surf/surf_resource.h"
+
 
 #undef GENERIC_LMM_ACTION
 #undef GENERIC_ACTION
 
 #undef GENERIC_LMM_ACTION
 #undef GENERIC_ACTION
index 6aabfd2..38834c5 100644 (file)
@@ -14,6 +14,7 @@
 #include "trace_mgr_private.h"
 #include "cpu_ti_private.h"
 #include "xbt/heap.h"
 #include "trace_mgr_private.h"
 #include "cpu_ti_private.h"
 #include "xbt/heap.h"
+#include "surf/surf_resource.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_ti, surf,
                                 "Logging specific to the SURF CPU TRACE INTEGRATION module");
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_ti, surf,
                                 "Logging specific to the SURF CPU TRACE INTEGRATION module");
index 65c2fe4..6d203b3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2011. 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,6 +9,9 @@
 #include "xbt/str.h"
 
 #include "surf/surfxml_parse_values.h"
 #include "xbt/str.h"
 
 #include "surf/surfxml_parse_values.h"
+#include "surf/surf_resource.h"
+#include "surf/surf_resource_lmm.h"
+
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
                                 "Logging specific to the SURF network module");
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
                                 "Logging specific to the SURF network module");
index bc94690..fc12e42 100644 (file)
@@ -17,6 +17,8 @@
 #include "surf_private.h"
 #include "xbt/dict.h"
 #include "maxmin_private.h"
 #include "surf_private.h"
 #include "xbt/dict.h"
 #include "maxmin_private.h"
+#include "surf/surf_resource_lmm.h"
+
 
 #undef GENERIC_ACTION
 #define GENERIC_ACTION(action) action->generic_action
 
 #undef GENERIC_ACTION
 #define GENERIC_ACTION(action) action->generic_action
index 95cdc8f..78f3834 100644 (file)
@@ -9,6 +9,9 @@
 #include "surf_private.h"
 #include "xbt/module.h"
 #include "mc/mc.h"
 #include "surf_private.h"
 #include "xbt/module.h"
 #include "mc/mc.h"
+#include "surf/surf_resource.h"
+//#include "surf/surf_resource_lmm.h"
+
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
                                 "Logging specific to SURF (kernel)");
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
                                 "Logging specific to SURF (kernel)");
index f67846a..0846990 100644 (file)
@@ -203,7 +203,7 @@ XBT_PUBLIC(void) routing_parse_Scluster(void);       /* cluster bypass */
 /**
  * Resource protected methods
  */
 /**
  * Resource protected methods
  */
-xbt_dict_t surf_resource_properties(const void *resource);
+static XBT_INLINE xbt_dict_t surf_resource_properties(const void *resource);
 
 XBT_PUBLIC(void) surfxml_bufferstack_push(int new);
 XBT_PUBLIC(void) surfxml_bufferstack_pop(int new);
 
 XBT_PUBLIC(void) surfxml_bufferstack_push(int new);
 XBT_PUBLIC(void) surfxml_bufferstack_pop(int new);
index 775641e..af28025 100644 (file)
@@ -146,7 +146,7 @@ static void parse_S_router(sg_platf_router_cbarg_t router)
   xbt_lib_set(as_router_lib,router->id,ROUTING_ASR_LEVEL,(void *) info);
   if (strcmp(router->coord,"")) {
        if(!COORD_ASR_LEVEL) xbt_die("To use coordinates, you must set configuration 'coordinates' to 'yes'");
   xbt_lib_set(as_router_lib,router->id,ROUTING_ASR_LEVEL,(void *) info);
   if (strcmp(router->coord,"")) {
        if(!COORD_ASR_LEVEL) xbt_die("To use coordinates, you must set configuration 'coordinates' to 'yes'");
-    xbt_dynar_t ctn = xbt_str_split_str(A_surfxml_router_coordinates, " ");
+    xbt_dynar_t ctn = xbt_str_split_str(router->coord, " ");
     xbt_dynar_shrink(ctn, 0);
     xbt_lib_set(as_router_lib,router->id,COORD_ASR_LEVEL,(void *) ctn);
   }
     xbt_dynar_shrink(ctn, 0);
     xbt_lib_set(as_router_lib,router->id,COORD_ASR_LEVEL,(void *) ctn);
   }
@@ -1932,27 +1932,3 @@ static void routing_parse_Srandom(void)
     }
 }
 
     }
 }
 
-
-/*
- * Set a new link on the actual list of link for a route or ASroute
- */
-void routing_add_link(const char *link_id)
-{
-  parse_E_link_c_ctn_new_elem_lua((char *) link_id);
-}
-
-/*
- *Set the endpoints for a route
- */
-void routing_set_route(const char *src_id, const char *dst_id)
-{
-  parse_S_route_new_and_endpoints_lua(src_id, dst_id);
-}
-
-/*
- * Store the route by calling parse_E_route_store_route
- */
-void routing_store_route(void)
-{
-  parse_E_route_store_route();
-}
index 915dfd7..2b21cc2 100644 (file)
@@ -633,122 +633,3 @@ static void add_randomness(void)
                &xbt_free_ref);
 }
 
                &xbt_free_ref);
 }
 
-/**
- * create CPU resource via CPU Model
- */
-void* surf_host_create_resource(char *name, double power_peak,
-                               double power_scale,
-                               tmgr_trace_t power_trace, int core,
-                               e_surf_resource_state_t state_initial,
-                               tmgr_trace_t state_trace,
-                               xbt_dict_t cpu_properties)
-{
-  return surf_cpu_model->extension.cpu.create_resource(name, power_peak,
-                                                       power_scale,
-                                                       power_trace,
-                                                       core,
-                                                       state_initial,
-                                                       state_trace,
-                                                       cpu_properties);
-}
-
-/**
- * create CPU resource via worsktation_ptask_L07 model
- */
-
-void* surf_wsL07_host_create_resource(char *name, double power_peak,
-                                     double power_scale,
-                                     tmgr_trace_t power_trace,
-                                     e_surf_resource_state_t state_initial,
-                                     tmgr_trace_t state_trace,
-                                     xbt_dict_t cpu_properties)
-{
-  return surf_workstation_model->extension.workstation.cpu_create_resource(name,
-                                                                    power_peak,
-                                                                    power_scale,
-                                                                    power_trace,
-                                                                    state_initial,
-                                                                    state_trace,
-                                                                    cpu_properties);
-}
-
-/**
- * create link resource via network Model
- */
-void* surf_link_create_resource(char *name,
-                               double bw_initial,
-                               tmgr_trace_t bw_trace,
-                               double lat_initial,
-                               tmgr_trace_t lat_trace,
-                               e_surf_resource_state_t
-                               state_initial,
-                               tmgr_trace_t state_trace,
-                               e_surf_link_sharing_policy_t policy,
-                               xbt_dict_t properties)
-{
-  return surf_network_model->extension.network.create_resource(name,
-                                                               bw_initial,
-                                                               bw_trace,
-                                                               lat_initial,
-                                                               lat_trace,
-                                                               state_initial,
-                                                               state_trace,
-                                                               policy,
-                                                               properties);
-}
-
-/**
- * create link resource via workstation_ptask_L07 model
- */
-
-void* surf_wsL07_link_create_resource(char *name,
-                                     double bw_initial,
-                                     tmgr_trace_t bw_trace,
-                                     double lat_initial,
-                                     tmgr_trace_t lat_trace,
-                                     e_surf_resource_state_t
-                                     state_initial,
-                                     tmgr_trace_t state_trace,
-                                     e_surf_link_sharing_policy_t
-                                     policy, xbt_dict_t properties)
-{
-  return surf_workstation_model->extension.workstation.
-      link_create_resource(name, bw_initial, bw_trace, lat_initial,
-                           lat_trace, state_initial, state_trace, policy,
-                           properties);
-}
-
-/**
- * set route
- */
-void surf_routing_add_route(const char *src_id, const char *dst_id,
-                            xbt_dynar_t links_id)
-{
-  unsigned int i;
-  const char *link_id;
-  routing_set_route(src_id, dst_id);
-  xbt_dynar_foreach(links_id, i, link_id) {
-    routing_add_link(link_id);
-  }
-
-  //store the route
-  routing_store_route();
-}
-
-/**
- * Add Traces
- */
-void surf_add_host_traces(void)
-{
-  return surf_cpu_model->extension.cpu.add_traces();
-}
-
-void surf_add_link_traces(void)
-{
-  return surf_network_model->extension.network.add_traces();
-}
-
-void surf_wsL07_add_traces(void)
-{
-  return surf_workstation_model->extension.workstation.add_traces();
-}
index 0a7641b..f54ec0c 100644 (file)
@@ -8,6 +8,9 @@
 #include "xbt/dict.h"
 #include "portable.h"
 #include "surf_private.h"
 #include "xbt/dict.h"
 #include "portable.h"
 #include "surf_private.h"
+#include "surf/surf_resource.h"
+
+
 
 typedef struct workstation_CLM03 {
   s_surf_resource_t generic_resource;   /* Must remain first to add this to a trace */
 
 typedef struct workstation_CLM03 {
   s_surf_resource_t generic_resource;   /* Must remain first to add this to a trace */
index ee32783..59ae446 100644 (file)
@@ -8,6 +8,8 @@
 #include "xbt/str.h"
 #include "xbt/dict.h"
 #include "surf_private.h"
 #include "xbt/str.h"
 #include "xbt/dict.h"
 #include "surf_private.h"
+#include "surf/surf_resource.h"
+//#include "surf/surf_resource_lmm.h"
 
 typedef enum {
   SURF_WORKSTATION_RESOURCE_CPU,
 
 typedef enum {
   SURF_WORKSTATION_RESOURCE_CPU,
index 103e1de..db55b75 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <stdio.h>
 #include "surf/surf.h"
 
 #include <stdio.h>
 #include "surf/surf.h"
+#include "surf/surf_resource.h"
 #include "surf/surfxml_parse.h" // for reset callback
 
 #include "xbt/log.h"
 #include "surf/surfxml_parse.h" // for reset callback
 
 #include "xbt/log.h"
index c539bcb..a958e39 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <stdio.h>
 #include "surf/surf.h"
 
 #include <stdio.h>
 #include "surf/surf.h"
+#include "surf/surf_resource.h"
 #include "surf/surfxml_parse.h" // for reset callback
 
 #include "xbt/log.h"
 #include "surf/surfxml_parse.h" // for reset callback
 
 #include "xbt/log.h"