#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 {
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 */
#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,
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);
/**
-/* 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
#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.
*/
-/* 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
#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)");
/* 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"
-/* 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"
+#include "surf/surf_resource.h"
+
typedef s_surf_action_lmm_t s_surf_action_cpu_Cas01_t,
*surf_action_cpu_Cas01_t;
-/* 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"
+#include "surf/surf_resource.h"
+
#undef GENERIC_LMM_ACTION
#undef GENERIC_ACTION
#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");
-/* 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
#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");
#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
#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)");
/**
* 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_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);
}
}
}
-
-/*
- * 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();
-}
&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();
-}
#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 */
#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,
#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 <stdio.h>
#include "surf/surf.h"
+#include "surf/surf_resource.h"
#include "surf/surfxml_parse.h" // for reset callback
#include "xbt/log.h"