xbt_swag_foreach_safe(action, next_action, running_actions) {
#ifdef HAVE_TRACING
-// COMMENTED BY DAVID
-// xbt_dynar_t route = used_routing->get_route(action->src, action->dst);
-//
-// link_CM02_t link;
-// unsigned int i;
-// xbt_dynar_foreach(route, i, link) {
-// TRACE_surf_link_set_utilization (link->lmm_resource.generic_resource.name,
-// action->generic_action.data, lmm_variable_getvalue(action->variable), now-delta, delta);
-// }
+ // COMMENTED BY DAVID
+ xbt_dynar_t route = global_routing->get_route(action->src_name, action->dst_name);
+
+ link_CM02_t link;
+ unsigned int i;
+ xbt_dynar_foreach(route, i, link) {
+ TRACE_surf_link_set_utilization (link->lmm_resource.generic_resource.name,
+ action->generic_action.data, lmm_variable_getvalue(action->variable), now-delta, delta);
+ }
#endif
deltap = delta;
if (action->latency > 0) {
Add a link_CM02_t *link and a int link_nb to network_card_CM02_t. It will represent local links for this node
Use the cluster_id for ->id */
- //xbt_dynar_t route = used_routing->get_route(src, dst); // COMMENTED BY DAVID
xbt_dynar_t route = global_routing->get_route(src_name, dst_name);
xbt_dynar_t back_route = NULL;
int constraints_per_variable = 0;
if( sg_network_fullduplex == 1){
- //back_route = used_routing->get_route(dst, src); // COMMENTED BY DAVID
back_route = global_routing->get_route(src_name, dst_name);
}
} /* LARGE PLATFORMS HACK:
expand also with src->link and dst->link */
+
+
XBT_OUT;
return (surf_action_t) action;
{
surf_model_exit(surf_network_model);
surf_network_model = NULL;
-
- //used_routing->finalize(); // COMMENTED BY DAVID
global_routing->finalize();
xbt_free(global_routing);
}
+static void get_onelink_routes(void)
+{
+ xbt_die("get_onelink_routes function not implemented yet!!!");
+}
+
+static int is_router(const char *name)
+{
+ xbt_die("is_router function not implemented yet!!!");
+}
+
/**
* \brief Generic method: create the global routing schema
*
static void generic_set_ASroute(routing_component_t rc, const char* src, const char* dst, route_extended_t e_route) {
DEBUG4("Load ASroute from \"%s(%s)\" to \"%s(%s)\"",src,e_route->src_gateway,dst,e_route->dst_gateway);
- printf("Load ASroute from \"%s(%s)\" to \"%s(%s)\"\n",src,e_route->src_gateway,dst,e_route->dst_gateway);
model_type_t modeltype = rc->routing;
xbt_dict_t _parse_routes;
xbt_dict_t _to_index;
xbt_dynar_t radical_elements;
xbt_dynar_t radical_ends;
- surfxml_bufferstack_push(1);
-
- /* allocating memory for the buffer, I think 2kB should be enough */
- // surfxml_bufferstack = xbt_new0(char, surfxml_bufferstack_size);
+ static int surfxml_buffer_stack_stack_ptr = 0;
+ static int surfxml_buffer_stack_stack[1024];
-// DEBUG4("id='%s' prefix='%s' suffix='%s' radical='%s'",
-// cluster_id,cluster_prefix,cluster_suffix,cluster_radical);
-// DEBUG5("power='%s' bw='%s' lat='%s' bb_bw='%s' bb_lat='%s'",
-// cluster_power,cluster_bw,cluster_lat,cluster_bb_bw,cluster_bb_lat);
+ surfxml_bufferstack_push(1);
DEBUG1("<AS id=\"%s\"\trouting=\"RuleBased\">",cluster_id);
SURFXML_BUFFER_SET(AS_id, cluster_id);
link_id = bprintf("%s_link_%d", cluster_id, start);
DEBUG2("<host\tid=\"%s\"\tpower=\"%s\"/>",host_id,cluster_power);
- SURFXML_BUFFER_RESET();
SURFXML_BUFFER_SET(host_id, host_id);
SURFXML_BUFFER_SET(host_power, cluster_power);
SURFXML_BUFFER_SET(host_availability, "1.0");
SURFXML_END_TAG(host);
DEBUG3("<link\tid=\"%s\"\tbw=\"%s\"\tlat=\"%s\"/>",link_id,cluster_bw,cluster_lat);
- SURFXML_BUFFER_RESET();
SURFXML_BUFFER_SET(link_id, link_id);
SURFXML_BUFFER_SET(link_bandwidth, cluster_bw);
SURFXML_BUFFER_SET(link_latency, cluster_lat);
link_id = bprintf("%s_link_%d", cluster_id, i);
DEBUG2("<host\tid=\"%s\"\tpower=\"%s\"/>",host_id,cluster_power);
- SURFXML_BUFFER_RESET();
SURFXML_BUFFER_SET(host_id, host_id);
SURFXML_BUFFER_SET(host_power, cluster_power);
SURFXML_BUFFER_SET(host_availability, "1.0");
SURFXML_END_TAG(host);
DEBUG3("<link\tid=\"%s\"\tbw=\"%s\"\tlat=\"%s\"/>",link_id,cluster_bw,cluster_lat);
- SURFXML_BUFFER_RESET();
SURFXML_BUFFER_SET(link_id, link_id);
SURFXML_BUFFER_SET(link_bandwidth, cluster_bw);
SURFXML_BUFFER_SET(link_latency, cluster_lat);
link_backbone = bprintf("%s_backbone",cluster_id);
DEBUG1("<router id=\"%s\"\">",router_id);
- SURFXML_BUFFER_RESET();
SURFXML_BUFFER_SET(router_id, router_id);;
SURFXML_START_TAG(router);
SURFXML_END_TAG(router);
DEBUG3("<link\tid=\"%s\"\tbw=\"%s\"\tlat=\"%s\"/>",link_router,cluster_bw,cluster_lat);
- SURFXML_BUFFER_RESET();
SURFXML_BUFFER_SET(link_id, link_router);
SURFXML_BUFFER_SET(link_bandwidth, cluster_bw);
SURFXML_BUFFER_SET(link_latency, cluster_lat);
SURFXML_END_TAG(link);
DEBUG3("<link\tid=\"%s\"\tbw=\"%s\"\tlat=\"%s\"/>",link_backbone,cluster_bb_bw,cluster_bb_lat);
- SURFXML_BUFFER_RESET();
SURFXML_BUFFER_SET(link_id, link_backbone);
SURFXML_BUFFER_SET(link_bandwidth, cluster_bb_bw);
SURFXML_BUFFER_SET(link_latency, cluster_bb_lat);
DEBUG0(" ");
DEBUG2("<route\tsrc=\"%s\"\tdst=\"%s\">",route_src_dst,route_src_dst);
- SURFXML_BUFFER_RESET();
SURFXML_BUFFER_SET(route_src, route_src_dst);
SURFXML_BUFFER_SET(route_dst, route_src_dst);
SURFXML_START_TAG(route);
DEBUG1("<link:ctn\tid=\"%s_link_$1src\"/>",cluster_id);
- SURFXML_BUFFER_RESET();
SURFXML_BUFFER_SET(link_c_ctn_id, bprintf("%s_link_$1src",cluster_id));
SURFXML_START_TAG(link_c_ctn);
SURFXML_END_TAG(link_c_ctn);
DEBUG1("<link:ctn\tid=\"%s_backbone\"/>",cluster_id);
- SURFXML_BUFFER_RESET();
SURFXML_BUFFER_SET(link_c_ctn_id, bprintf("%s_backbone",cluster_id));
SURFXML_START_TAG(link_c_ctn);
SURFXML_END_TAG(link_c_ctn);
DEBUG1("<link:ctn\tid=\"%s_link_$1dst\"/>",cluster_id);
- SURFXML_BUFFER_RESET();
SURFXML_BUFFER_SET(link_c_ctn_id, bprintf("%s_link_$1dst",cluster_id));
SURFXML_START_TAG(link_c_ctn);
SURFXML_END_TAG(link_c_ctn);
/* This buffer is used to store the original buffer before substituting it by out own buffer. Useful for the foreach tag */
static xbt_dynar_t surfxml_bufferstack_stack = NULL;
int surfxml_bufferstack_size = 2048;
+
static char *old_buff = NULL;
static void surf_parse_error(char *msg);
{
/* If needed aditional properties can be added by using the prop tag */
random_data_t random = random_new(random_generator, 0, random_min, random_max, random_mean, random_std_deviation);
- xbt_dict_set(random_data_list, random_id, (void *) random, &xbt_free_ref); // FIX BY DAVID, add the xbt_free_ref function
+ xbt_dict_set(random_data_list, random_id, (void *) random, &xbt_free_ref);
}
/**
void surf_route_set_resource(char *source_id,char *destination_id,xbt_dynar_t links_id,int action)
{
xbt_die("\"surf_route_set_resource\" not support");
- //route_link_list = xbt_dynar_new(sizeof(char *), NULL); // COMMENTED BY DAVID
- //routing_add_route(source_id,destination_id,links_id,action); // COMMENTED BY DAVID
+ //route_link_list = xbt_dynar_new(sizeof(char *), NULL);
+ //routing_add_route(source_id,destination_id,links_id,action);
}
void surf_route_add_host(char *host_id)
{
xbt_die("\"surf_route_add_host\" not support");
- //routing_add_host(host_id); // COMMENTED BY DAVID
+ //routing_add_host(host_id);
}
/**
void surf_set_routes(void)
{
xbt_die("\"surf_set_routes\" not support");
- //routing_set_routes(); // COMMENTED BY DAVID
+ //routing_set_routes();
}