src/surf/gtnets/gtnets_topology.h
src/surf/cpu_ti_private.h
src/surf/surf_routing_private.h
+ src/include/simgrid/platf_interface.h
src/include/surf/surf_resource.h
src/include/surf/datatypes.h
src/include/surf/maxmin.h
src/surf/workstation_ptask_L07.c
src/surf/cpu_ti.c
src/surf/cpu_im.c
+ src/surf/sg_platf.c
src/xbt/xbt_sg_stubs.c
)
#include <xbt.h> /* our toolbox */
+typedef struct tmgr_trace *tmgr_trace_t; /**< Opaque structure defining an availability trace */
+
+/** Defines whether a given resource is working or not */
+typedef enum {
+ SURF_RESOURCE_ON = 1, /**< Up & ready */
+ SURF_RESOURCE_OFF = 0 /**< Down & broken */
+} e_surf_resource_state_t;
+
+
+typedef struct s_surf_parsing_host_arg {
+ char* V_host_id; //id
+ double V_host_power_peak; //power
+ int V_host_core; //core
+ double V_host_power_scale; //availability
+ tmgr_trace_t V_host_power_trace; //availability file
+ e_surf_resource_state_t V_host_state_initial; //state
+ tmgr_trace_t V_host_state_trace; //state file
+ const char* V_host_coord;
+} s_surf_parsing_host_arg_t, *surf_parsing_host_arg_t;
+
+
XBT_PUBLIC(void) sg_platf_new_AS_open(const char *id, const char *mode);
XBT_PUBLIC(void) sg_platf_new_AS_close(void);
--- /dev/null
+/* platf_interface.h - Internal interface to the SimGrid platforms */
+
+/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010, 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. */
+
+#ifndef SG_PLATF_INTERFACE_H
+#define SG_PLATF_INTERFACE_H
+
+#include "simgrid/platf.h" /* public interface */
+
+/* Module management functions */
+void sg_platf_init(void);
+void sg_platf_exit(void);
+
+/* Managing the parsing callbacks */
+
+typedef void (*surf_parse_host_fct_t)(surf_parsing_host_arg_t);
+void surf_parse_host_add_cb(surf_parse_host_fct_t);
+
+void surf_parse_host(surf_parsing_host_arg_t h);
+
+
+
+#endif /* SG_PLATF_INTERFACE_H */
typedef struct lmm_system *lmm_system_t;
typedef struct tmgr_history *tmgr_history_t;
-typedef struct tmgr_trace *tmgr_trace_t;
typedef struct tmgr_trace_event *tmgr_trace_event_t;
#include "surf/datatypes.h"
#include "xbt/lib.h"
#include "surf/surf_routing.h"
+#include "simgrid/platf_interface.h"
SG_BEGIN_DECL()
/* Actions and models are highly connected structures... */
-typedef enum {
- SURF_RESOURCE_ON = 1, /**< Up & ready */
- SURF_RESOURCE_OFF = 0 /**< Down & broken */
-} e_surf_resource_state_t;
typedef enum {
SURF_LINK_FULLDUPLEX = 2,
char* V_router_coord;
} s_surf_parsing_router_arg_t;
-typedef struct s_surf_parsing_host_arg *surf_parsing_host_arg_t;
-typedef struct s_surf_parsing_host_arg {
- char* V_host_id; //id
- double V_host_power_peak; //power
- int V_host_core; //core
- double V_host_power_scale; //availability
- tmgr_trace_t V_host_power_trace; //availability file
- e_surf_resource_state_t V_host_state_initial; //state
- tmgr_trace_t V_host_state_trace; //state file
- const char* V_host_coord;
-} s_surf_parsing_host_arg_t;
-
typedef struct s_surf_parsing_link_up_down *surf_parsing_link_up_down_t;
typedef struct s_surf_parsing_link_up_down {
void* link_up;
} s_surf_parsing_link_up_down_t;
-typedef void (*surf_parse_host_fct_t)(surf_parsing_host_arg_t);
-void surf_parse_host_add_cb(surf_parse_host_fct_t);
-
extern surf_parsing_router_arg_t struct_router;
extern surf_parsing_cluster_arg_t struct_cluster;
extern surf_parsing_peer_arg_t struct_peer;
extern surf_parsing_link_arg_t struct_lnk;
-void surf_parse_host(surf_parsing_host_arg_t h);
void surf_parse_link(void);
#endif /* SURFXML_PARSE_VALUES_H_ */
#include "xbt/dynar.h"
#include "surf/maxmin.h"
#include "surf/datatypes.h"
+#include "simgrid/platf_interface.h"
/* Creation functions */
XBT_PUBLIC(tmgr_history_t) tmgr_history_new(void);
--- /dev/null
+/* Copyright (c) 2006, 2007, 2008, 2009, 2010, 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 "xbt/misc.h"
+#include "xbt/log.h"
+#include "xbt/str.h"
+#include "xbt/dict.h"
+#include "simgrid/platf_interface.h"
+#include "surf/surf_private.h"
+
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
+xbt_dynar_t surf_parse_host_cb_list = NULL; // of functions of type: surf_parsing_host_arg_t -> void
+
+/** Module management function: creates all internal data structures */
+void sg_platf_init(void) {
+ surf_parse_host_cb_list = xbt_dynar_new(sizeof(surf_parse_host_fct_t), NULL);
+}
+/** Module management function: frees all internal data structures */
+void sg_platf_exit(void) {
+ xbt_dynar_free(&surf_parse_host_cb_list);
+}
+
+void surf_parse_host(surf_parsing_host_arg_t h){
+ unsigned int iterator;
+ surf_parse_host_fct_t fun;
+ xbt_dynar_foreach(surf_parse_host_cb_list, iterator, fun) {
+ if (fun) (*fun) (h);
+ }
+}
+void surf_parse_host_add_cb(surf_parse_host_fct_t fct) {
+ xbt_dynar_push(surf_parse_host_cb_list, &fct);
+}
#include <pcre.h> /* regular expression library */
-#include "simgrid/platf.h" // platform creation API
+#include "simgrid/platf_interface.h" // platform creation API internal interface
#include "surf_routing_private.h"
#include "surf/surf_routing.h"
/* make sure these symbols are defined as strong ones in this file so that the linker can resolve them */
//xbt_dynar_t STag_surfxml_host_cb_list = NULL;
-xbt_dynar_t surf_parse_host_cb_list = NULL; // of functions of type: surf_parsing_host_arg_t -> void
xbt_dynar_t STag_surfxml_platform_cb_list = NULL;
xbt_dynar_t ETag_surfxml_platform_cb_list = NULL;
xbt_dynar_t ETag_surfxml_host_cb_list = NULL;
ETag_surfxml_platform_cb_list =
xbt_dynar_new(sizeof(void_f_void_t), NULL);
- surf_parse_host_cb_list = xbt_dynar_new(sizeof(surf_parse_host_fct_t), NULL);
-
+ sg_platf_init();
ETag_surfxml_host_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
STag_surfxml_router_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
ETag_surfxml_router_cb_list = xbt_dynar_new(sizeof(void_f_void_t), NULL);
void surf_parse_free_callbacks(void)
{
- xbt_dynar_free(&surf_parse_host_cb_list);
+ sg_platf_exit();
xbt_dynar_free(&STag_surfxml_platform_cb_list);
xbt_dynar_free(&ETag_surfxml_platform_cb_list);
}
void STag_surfxml_host(void){
-// XBT_INFO("STag_surfxml_host [%s]",A_surfxml_host_id);
s_surf_parsing_host_arg_t host;
memset(&host,0,sizeof(host));
surf_parse_host(&host);
}
-void surf_parse_host(surf_parsing_host_arg_t h){
- unsigned int iterator;
- surf_parse_host_fct_t fun;
- xbt_dynar_foreach(surf_parse_host_cb_list, iterator, fun) {
- if (fun) (*fun) (h);
- }
-}
-void surf_parse_host_add_cb(surf_parse_host_fct_t fct) {
- xbt_dynar_push(surf_parse_host_cb_list, &fct);
-}
void ETag_surfxml_host(void){
surfxml_call_cb_functions(ETag_surfxml_host_cb_list);
}