Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cleanup.
[simgrid.git] / src / surf / surf_routing_private.hpp
1 /* Copyright (c) 2009-2011, 2013-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef _SURF_SURF_ROUTING_PRIVATE_H
8 #define _SURF_SURF_ROUTING_PRIVATE_H
9
10 #include <float.h>
11 #include "internal_config.h"
12
13 #include "surf_interface.hpp"
14 #include "xbt/dynar.h"
15 #include "xbt/str.h"
16 #include "xbt/config.h"
17 #include "xbt/graph.h"
18 #include "xbt/set.h"
19 #include "surf/surfxml_parse.h"
20
21 /* ************************************************************************** */
22 /* ******************************* NO ROUTING ******************************* */
23 /* Only save the AS tree, and forward calls to child ASes */
24 AS_t model_none_create(void);
25 AS_t model_none_create_sized(size_t childsize);
26 void model_none_finalize(AS_t as);
27 /* ************************************************************************** */
28 /* ***************** GENERIC PARSE FUNCTIONS (declarations) ***************** */
29 AS_t model_generic_create_sized(size_t childsize);
30 void model_generic_finalize(AS_t as);
31
32 int generic_parse_PU(AS_t rc, sg_routing_edge_t elm);
33 int generic_parse_AS(AS_t rc, sg_routing_edge_t elm);
34 void generic_parse_bypassroute(AS_t rc, sg_platf_route_cbarg_t e_route);
35
36 /* ************************************************************************** */
37 /* *************** GENERIC BUSINESS METHODS (declarations) ****************** */
38
39 xbt_dynar_t generic_get_onelink_routes(AS_t rc);
40 sg_platf_route_cbarg_t generic_get_bypassroute(AS_t rc,
41     sg_routing_edge_t src,
42     sg_routing_edge_t dst,
43     double *lat);
44
45 /* ************************************************************************** */
46 /* ****************** GENERIC AUX FUNCTIONS (declarations) ****************** */
47
48 /* change a route containing link names into a route containing link entities.
49  * If change_order is true, the links are put in reverse order in the
50  * produced route */
51 sg_platf_route_cbarg_t generic_new_extended_route(e_surf_routing_hierarchy_t hierarchy,
52                                    sg_platf_route_cbarg_t data, int preserve_order);
53 AS_t
54 generic_autonomous_system_exist(AS_t rc, char *element);
55 AS_t
56 generic_processing_units_exist(AS_t rc, char *element);
57 void generic_src_dst_check(AS_t rc, sg_routing_edge_t src,
58     sg_routing_edge_t dst);
59
60 /* ************************************************************************** */
61 /* *************************** FLOYD ROUTING ******************************** */
62 AS_t model_floyd_create(void);  /* create structures for floyd routing model */
63 void model_floyd_end(AS_t as);      /* finalize the creation of floyd routing model */
64 void model_floyd_parse_route(AS_t rc, sg_platf_route_cbarg_t route);
65
66 /* ************************************************** */
67 /* **************  Cluster ROUTING   **************** */
68
69 AsPtr model_cluster_create(void);      /* create structures for cluster routing model */
70 AsPtr model_torus_cluster_create(void);      /* create structures for cluster routing model */
71
72
73 /* ************************************************** */
74 /* **************  Vivaldi ROUTING   **************** */
75 AS_t model_vivaldi_create(void);      /* create structures for vivaldi routing model */
76 #define HOST_PEER(peername) bprintf("peer_%s", peername)
77 #define ROUTER_PEER(peername) bprintf("router_%s", peername)
78 #define LINK_PEER(peername) bprintf("link_%s", peername)
79
80 /* ************************************************************************** */
81 /* ********** Dijkstra & Dijkstra Cached ROUTING **************************** */
82 AS_t model_dijkstra_both_create(int cached);    /* create by calling dijkstra or dijkstracache */
83 AS_t model_dijkstra_create(void);       /* create structures for dijkstra routing model */
84 AS_t model_dijkstracache_create(void);  /* create structures for dijkstracache routing model */
85 void model_dijkstra_both_end(AS_t as);      /* finalize the creation of dijkstra routing model */
86 void model_dijkstra_both_parse_route (AS_t rc, sg_platf_route_cbarg_t route);
87
88 /* ************************************************************************** */
89 /* *************************** FULL ROUTING ********************************* */
90 AS_t model_full_create(void);   /* create structures for full routing model */
91 void model_full_end(AS_t as);       /* finalize the creation of full routing model */
92 void model_full_set_route(  /* Set the route and ASroute between src and dst */
93     AS_t rc, sg_platf_route_cbarg_t route);
94 /* ************************************************************************** */
95 /* ************************* GRAPH EXPORTING FUNCTIONS ********************** */
96 xbt_node_t new_xbt_graph_node (xbt_graph_t graph, const char *name, xbt_dict_t nodes);
97 xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges);
98
99
100 #endif                          /* _SURF_SURF_ROUTING_PRIVATE_H */