X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4ddbd30b67dea473bb8c43c6c226a3b3a5af987e..dec88cb5450df90eb490d9bf0655184904981438:/src/surf/surf_routing_private.h diff --git a/src/surf/surf_routing_private.h b/src/surf/surf_routing_private.h index 27d520416d..b63fb23a9c 100644 --- a/src/surf/surf_routing_private.h +++ b/src/surf/surf_routing_private.h @@ -1,15 +1,14 @@ -/* - * surf_routing_private.h - * - * Created on: 14 avr. 2011 - * Author: navarrop - */ +/* Copyright (c) 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 _SURF_SURF_ROUTING_PRIVATE_H #define _SURF_SURF_ROUTING_PRIVATE_H #include -#include "gras_config.h" +#include "internal_config.h" #include "surf_private.h" #include "xbt/dynar.h" @@ -19,93 +18,91 @@ #include "xbt/set.h" #include "surf/surfxml_parse.h" +/* ************************************************************************** */ +/* ******************************* NO ROUTING ******************************* */ +/* Only save the AS tree, and forward calls to child ASes */ +AS_t model_none_create(void); +AS_t model_none_create_sized(size_t childsize); +void model_none_finalize(AS_t as); /* ************************************************************************** */ /* ***************** GENERIC PARSE FUNCTIONS (declarations) ***************** */ +AS_t model_generic_create_sized(size_t childsize); +void model_generic_finalize(AS_t as); -void generic_set_processing_unit(routing_component_t rc, - const char *name); -void generic_set_autonomous_system(routing_component_t rc, - const char *name); -void generic_set_bypassroute(routing_component_t rc, - const char *src, const char *dst, - route_extended_t e_route); - -int surf_link_resource_cmp(const void *a, const void *b); -int surf_pointer_resource_cmp(const void *a, const void *b); +int generic_parse_PU(AS_t rc, sg_routing_edge_t elm); +int generic_parse_AS(AS_t rc, sg_routing_edge_t elm); +void generic_parse_bypassroute(AS_t rc, sg_platf_route_cbarg_t e_route); /* ************************************************************************** */ /* *************** GENERIC BUSINESS METHODS (declarations) ****************** */ -double generic_get_link_latency(routing_component_t rc, const char *src, const char *dst, - route_extended_t e_route); -xbt_dynar_t generic_get_onelink_routes(routing_component_t rc); -route_extended_t generic_get_bypassroute(routing_component_t rc, - const char *src, - const char *dst); +xbt_dynar_t generic_get_onelink_routes(AS_t rc); +sg_platf_route_cbarg_t generic_get_bypassroute(AS_t rc, + sg_routing_edge_t src, + sg_routing_edge_t dst, + double *lat); /* ************************************************************************** */ /* ****************** GENERIC AUX FUNCTIONS (declarations) ****************** */ -route_extended_t -generic_new_extended_route(e_surf_routing_hierarchy_t hierarchy, - void *data, int order); -route_t -generic_new_route(e_surf_routing_hierarchy_t hierarchy, - void *data, int order); -void generic_free_route(route_t route); -void generic_free_extended_route(route_extended_t e_route); -routing_component_t -generic_autonomous_system_exist(routing_component_t rc, char *element); -routing_component_t -generic_processing_units_exist(routing_component_t rc, char *element); -void generic_src_dst_check(routing_component_t rc, const char *src, - const char *dst); - +/* change a route containing link names into a route containing link entities. + * If change_order is true, the links are put in reverse order in the + * produced route */ +sg_platf_route_cbarg_t generic_new_extended_route(e_surf_routing_hierarchy_t hierarchy, + sg_platf_route_cbarg_t data, int preserve_order); +AS_t +generic_autonomous_system_exist(AS_t rc, char *element); +AS_t +generic_processing_units_exist(AS_t rc, char *element); +void generic_src_dst_check(AS_t rc, sg_routing_edge_t src, + sg_routing_edge_t dst); /* ************************************************************************** */ /* *************************** FLOYD ROUTING ******************************** */ -routing_component_t model_floyd_create(void); /* create structures for floyd routing model */ -void model_floyd_end(void); /* finalize the creation of floyd routing model */ -void model_floyd_set_route(routing_component_t rc, const char *src, - const char *dst, name_route_extended_t route); +AS_t model_floyd_create(void); /* create structures for floyd routing model */ +void model_floyd_end(AS_t as); /* finalize the creation of floyd routing model */ +void model_floyd_parse_route(AS_t rc, sg_platf_route_cbarg_t route); /* ************************************************** */ /* ************** RULE-BASED ROUTING **************** */ -routing_component_t model_rulebased_create(void); /* create structures for rulebased routing model */ +AS_t model_rulebased_create(void); /* create structures for rulebased routing model */ /* ************************************************** */ /* ************** Cluster ROUTING **************** */ -routing_component_t model_cluster_create(void); /* create structures for cluster routing model */ -void model_cluster_unload(void); /* Finalize the routing model */ +typedef struct { + s_as_t generic_routing; + void *backbone; + void *loopback; + sg_routing_edge_t router; +} s_as_cluster_t, *as_cluster_t; -void surf_routing_cluster_add_link(const char* host_id,surf_parsing_link_up_down_t info); +AS_t model_cluster_create(void); /* create structures for cluster routing model */ /* ************************************************** */ /* ************** Vivaldi ROUTING **************** */ -routing_component_t model_vivaldi_create(void); /* create structures for vivaldi routing model */ +AS_t model_vivaldi_create(void); /* create structures for vivaldi routing model */ #define HOST_PEER(peername) bprintf("peer_%s", peername) #define ROUTER_PEER(peername) bprintf("router_%s", peername) -#define LINK_UP_PEER(peername) bprintf("link_%s_up", peername) -#define LINK_DOWN_PEER(peername) bprintf("link_%s_down", peername) +#define LINK_PEER(peername) bprintf("link_%s", peername) /* ************************************************************************** */ /* ********** Dijkstra & Dijkstra Cached ROUTING **************************** */ -routing_component_t model_dijkstra_both_create(int cached); /* create by calling dijkstra or dijkstracache */ -routing_component_t model_dijkstra_create(void); /* create structures for dijkstra routing model */ -routing_component_t model_dijkstracache_create(void); /* create structures for dijkstracache routing model */ -void model_dijkstra_both_end(void); /* finalize the creation of dijkstra routing model */ -void model_dijkstra_both_set_route (routing_component_t rc, const char *src, - const char *dst, name_route_extended_t route); +AS_t model_dijkstra_both_create(int cached); /* create by calling dijkstra or dijkstracache */ +AS_t model_dijkstra_create(void); /* create structures for dijkstra routing model */ +AS_t model_dijkstracache_create(void); /* create structures for dijkstracache routing model */ +void model_dijkstra_both_end(AS_t as); /* finalize the creation of dijkstra routing model */ +void model_dijkstra_both_parse_route (AS_t rc, sg_platf_route_cbarg_t route); /* ************************************************************************** */ /* *************************** FULL ROUTING ********************************* */ -routing_component_t model_full_create(void); /* create structures for full routing model */ -void model_full_end(void); /* finalize the creation of full routing model */ -void model_full_set_route( /* Set the route and ASroute between src and dst */ - routing_component_t rc, const char *src, const char *dst, name_route_extended_t route); - +AS_t model_full_create(void); /* create structures for full routing model */ +void model_full_end(AS_t as); /* finalize the creation of full routing model */ +void model_full_set_route( /* Set the route and ASroute between src and dst */ + AS_t rc, sg_platf_route_cbarg_t route); /* ************************************************************************** */ -/* ******************************* NO ROUTING ******************************* */ -routing_component_t model_none_create(void); /* none routing model */ +/* ************************* GRAPH EXPORTING FUNCTIONS ********************** */ +xbt_node_t new_xbt_graph_node (xbt_graph_t graph, const char *name, xbt_dict_t nodes); +xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges); + #endif /* _SURF_SURF_ROUTING_PRIVATE_H */