1 /* Copyright (c) 2009 The SimGrid team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "surf_private.h"
10 #include "xbt/config.h"
11 #include "xbt/graph.h"
14 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route,surf,"Routing part of surf");// FIXME: connect this under windows
16 routing_t used_routing = NULL;
18 /* Prototypes of each model */
19 static void routing_model_full_create(size_t size_of_link,void *loopback);
20 static void routing_model_floyd_create(size_t size_of_link, void*loopback);
21 static void routing_model_dijkstra_create(size_t size_of_link, void*loopback);
22 static void routing_model_dijkstracache_create(size_t size_of_link, void*loopback);
24 /* Definition of each model */
28 void (*fun)(size_t,void*);
30 struct model_type models[] =
31 { {"Full", "Full routing data (fast, large memory requirements, fully expressive)", routing_model_full_create },
32 {"Floyd", "Floyd routing data (slow initialization, fast lookup, lesser memory requirements, shortest path routing only)", routing_model_floyd_create },
33 {"Dijkstra", "Dijkstra routing data (fast initialization, slow lookup, small memory requirements, shortest path routing only)", routing_model_dijkstra_create },
34 {"DijkstraCache", "Dijkstra routing data (fast initialization, fast lookup, small memory requirements, shortest path routing only)", routing_model_dijkstracache_create },
38 void routing_model_create(size_t size_of_links, void* loopback) {
40 char * wanted=xbt_cfg_get_string(_surf_cfg_set,"routing");
42 for (cpt=0;models[cpt].name;cpt++) {
43 if (!strcmp(wanted,models[cpt].name)) {
44 (*(models[cpt].fun))(size_of_links,loopback);
48 fprintf(stderr,"Routing model %s not found. Existing models:\n",wanted);
49 for (cpt=0;models[cpt].name;cpt++)
50 if (!strcmp(wanted,models[cpt].name))
51 fprintf(stderr," %s: %s\n",models[cpt].name,models[cpt].desc);
55 /* ************************************************************************** */
56 /* *************************** FULL ROUTING ********************************* */
58 s_routing_t generic_routing;
59 xbt_dynar_t *routing_table;
62 } s_routing_full_t,*routing_full_t;
64 #define ROUTE_FULL(i,j) ((routing_full_t)used_routing)->routing_table[(i)+(j)*(used_routing)->host_count]
69 static void routing_full_parse_Shost(void) {
70 int *val = xbt_malloc(sizeof(int));
71 DEBUG2("Seen host %s (#%d)",A_surfxml_host_id,used_routing->host_count);
72 *val = used_routing->host_count++;
73 xbt_dict_set(used_routing->host_id,A_surfxml_host_id,val,xbt_free);
75 static int src_id = -1;
76 static int dst_id = -1;
77 static void routing_full_parse_Sroute_set_endpoints(void)
79 src_id = *(int*)xbt_dict_get(used_routing->host_id,A_surfxml_route_src);
80 dst_id = *(int*)xbt_dict_get(used_routing->host_id,A_surfxml_route_dst);
81 DEBUG4("Route %s %d -> %s %d",A_surfxml_route_src,src_id,A_surfxml_route_dst,dst_id);
82 route_action = A_surfxml_route_action;
84 static void routing_full_parse_Eroute(void)
87 if (src_id != -1 && dst_id != -1) {
88 name = bprintf("%x#%x", src_id, dst_id);
89 manage_route(route_table, name, route_action, 0);
95 static void routing_full_parse_end(void) {
96 routing_full_t routing = (routing_full_t) used_routing;
99 xbt_dict_cursor_t cursor = NULL;
100 char *key, *data, *end;
101 const char *sep = "#";
102 xbt_dynar_t links, keys;
103 char *link_name = NULL;
106 int host_count = routing->generic_routing.host_count;
108 /* Create the routing table */
109 routing->routing_table = xbt_new0(xbt_dynar_t, host_count * host_count);
110 for (i=0;i<host_count;i++)
111 for (j=0;j<host_count;j++)
112 ROUTE_FULL(i,j) = xbt_dynar_new(routing->size_of_link,NULL);
114 /* Put the routes in position */
115 xbt_dict_foreach(route_table, cursor, key, data) {
117 links = (xbt_dynar_t) data;
118 keys = xbt_str_split_str(key, sep);
120 src_id = strtol(xbt_dynar_get_as(keys, 0, char *), &end, 16);
121 dst_id = strtol(xbt_dynar_get_as(keys, 1, char *), &end, 16);
122 xbt_dynar_free(&keys);
124 DEBUG4("Handle %d %d (from %d hosts): %ld links",
125 src_id,dst_id,routing->generic_routing.host_count,xbt_dynar_length(links));
126 xbt_dynar_foreach(links, cpt, link_name) {
127 void* link = xbt_dict_get_or_null(surf_network_model->resource_set, link_name);
129 xbt_dynar_push(ROUTE_FULL(src_id,dst_id),&link);
131 THROW1(mismatch_error,0,"Link %s not found", link_name);
135 /* Add the loopback if needed */
136 for (i = 0; i < host_count; i++)
137 if (!xbt_dynar_length(ROUTE_FULL(i, i)))
138 xbt_dynar_push(ROUTE_FULL(i,i),&routing->loopback);
140 /* Shrink the dynar routes (save unused slots) */
141 for (i=0;i<host_count;i++)
142 for (j=0;j<host_count;j++)
143 xbt_dynar_shrink(ROUTE_FULL(i,j),0);
149 static xbt_dynar_t routing_full_get_route(int src,int dst) {
150 return ROUTE_FULL(src,dst);
153 static void routing_full_finalize(void) {
154 routing_full_t routing = (routing_full_t)used_routing;
158 for (i = 0; i < used_routing->host_count; i++)
159 for (j = 0; j < used_routing->host_count; j++)
160 xbt_dynar_free(&ROUTE_FULL(i, j));
161 free(routing->routing_table);
162 xbt_dict_free(&used_routing->host_id);
168 static void routing_model_full_create(size_t size_of_link,void *loopback) {
169 /* initialize our structure */
170 routing_full_t routing = xbt_new0(s_routing_full_t,1);
171 routing->generic_routing.name = "Full";
172 routing->generic_routing.host_count = 0;
173 routing->generic_routing.get_route = routing_full_get_route;
174 routing->generic_routing.finalize = routing_full_finalize;
175 routing->size_of_link = size_of_link;
176 routing->loopback = loopback;
178 /* Set it in position */
179 used_routing = (routing_t) routing;
181 /* Setup the parsing callbacks we need */
182 routing->generic_routing.host_id = xbt_dict_new();
183 surfxml_add_callback(STag_surfxml_host_cb_list, &routing_full_parse_Shost);
184 surfxml_add_callback(ETag_surfxml_platform_cb_list, &routing_full_parse_end);
185 surfxml_add_callback(STag_surfxml_route_cb_list,
186 &routing_full_parse_Sroute_set_endpoints);
187 surfxml_add_callback(ETag_surfxml_route_cb_list, &routing_full_parse_Eroute);
190 /* ************************************************************************** */
191 /* *************************** FLOYD ROUTING ********************************* */
193 s_routing_t generic_routing;
195 int *predecessor_table;
200 } s_routing_floyd_t,*routing_floyd_t;
204 #define FLOYD_COST(i,j) ((routing_floyd_t)used_routing)->cost_table[(i)+(j)*(used_routing)->host_count]
205 #define FLOYD_PRED(i,j) ((routing_floyd_t)used_routing)->predecessor_table[(i)+(j)*(used_routing)->host_count]
206 #define FLOYD_LINK(i,j) ((routing_floyd_t)used_routing)->link_table[(i)+(j)*(used_routing)->host_count]
208 static void routing_floyd_parse_end(void) {
210 routing_floyd_t routing = (routing_floyd_t) used_routing;
212 unsigned int cpt = 0;
213 void* link_list = NULL;
214 xbt_dict_cursor_t cursor = NULL;
215 char *key,*data, *end;
216 const char *sep = "#";
217 xbt_dynar_t links, keys;
218 char *link_name = NULL;
222 int host_count = routing->generic_routing.host_count;
224 /* Create Cost, Predecessor and Link tables */
225 routing->cost_table = xbt_new0(double, host_count * host_count); //link cost from host to host
226 routing->predecessor_table = xbt_new0(int, host_count*host_count); //predecessor host numbers
227 routing->link_table = xbt_new0(void*,host_count*host_count); //actual link between src and dst
229 /* Initialize costs and predecessors*/
230 for(i = 0; i<host_count;i++)
231 for(j = 0; j<host_count;j++) {
232 FLOYD_COST(i,j) = DBL_MAX;
233 FLOYD_PRED(i,j) = -1;
236 /* Put the routes in position */
237 xbt_dict_foreach(route_table, cursor, key, data) {
239 links = (xbt_dynar_t)data;
240 keys = xbt_str_split_str(key, sep);
243 src_id = strtol(xbt_dynar_get_as(keys, 0, char*), &end, 16);
244 dst_id = strtol(xbt_dynar_get_as(keys, 1, char*), &end, 16);
245 xbt_dynar_free(&keys);
247 DEBUG4("Handle %d %d (from %d hosts): %ld links",
248 src_id,dst_id,routing->generic_routing.host_count,xbt_dynar_length(links));
249 xbt_assert3(xbt_dynar_length(links) == 1, "%ld links in route between host %d and %d, should be 1", xbt_dynar_length(links), src_id, dst_id);
251 xbt_dynar_foreach (links, cpt, link_name) {
252 void* link = xbt_dict_get_or_null(surf_network_model->resource_set, link_name);
256 THROW1(mismatch_error,0,"Link %s not found", link_name);
260 FLOYD_LINK(src_id,dst_id) = link_list;
261 FLOYD_PRED(src_id, dst_id) = src_id;
264 FLOYD_COST(src_id, dst_id) = 1; // assume 1 for now
268 /* Add the loopback if needed */
269 for (i = 0; i < host_count; i++)
270 if (!FLOYD_PRED(i, i)) {
271 FLOYD_PRED(i, i) = i;
272 FLOYD_COST(i, i) = 1;
273 FLOYD_LINK(i, i) = routing->loopback;
277 //Calculate path costs
279 for(c=0;c<host_count;c++) {
280 for(a=0;a<host_count;a++) {
281 for(b=0;b<host_count;b++) {
282 if(FLOYD_COST(a,c) < DBL_MAX && FLOYD_COST(c,b) < DBL_MAX) {
283 if(FLOYD_COST(a,b) == DBL_MAX || (FLOYD_COST(a,c)+FLOYD_COST(c,b) < FLOYD_COST(a,b))) {
284 FLOYD_COST(a,b) = FLOYD_COST(a,c)+FLOYD_COST(c,b);
285 FLOYD_PRED(a,b) = FLOYD_PRED(c,b);
296 static xbt_dynar_t routing_floyd_get_route(int src_id,int dst_id) {
298 routing_floyd_t routing = (routing_floyd_t) used_routing;
303 xbt_dynar_t link_list = xbt_dynar_new(routing->size_of_link, NULL);
307 pred = FLOYD_PRED(src_id, pred);
309 if(pred == -1) // if no pred in route -> no route to host
312 xbt_dynar_unshift(link_list, &FLOYD_LINK(pred,prev_pred));
314 } while(pred != src_id);
316 xbt_assert2(pred != -1, "no route from host %d to %d", src_id, dst_id);
321 static void routing_floyd_finalize_route(xbt_dynar_t route) {
322 xbt_dynar_free(&route);
325 static void routing_floyd_finalize(void) {
326 routing_floyd_t routing = (routing_floyd_t)used_routing;
329 free(routing->link_table);
330 free(routing->cost_table);
331 free(routing->predecessor_table);
332 xbt_dict_free(&used_routing->host_id);
338 static void routing_model_floyd_create(size_t size_of_link,void *loopback) {
339 /* initialize our structure */
340 routing_floyd_t routing = xbt_new0(s_routing_floyd_t,1);
341 routing->generic_routing.name = "Floyd";
342 routing->generic_routing.host_count = 0;
343 routing->generic_routing.get_route = routing_floyd_get_route;
344 routing->generic_routing.finalize = routing_floyd_finalize;
345 routing->generic_routing.finalize_route = routing_floyd_finalize_route;
346 routing->size_of_link = size_of_link;
347 routing->loopback = loopback;
349 /* Set it in position */
350 used_routing = (routing_t) routing;
352 /* Setup the parsing callbacks we need */
353 routing->generic_routing.host_id = xbt_dict_new();
354 surfxml_add_callback(STag_surfxml_host_cb_list, &routing_full_parse_Shost);
355 surfxml_add_callback(ETag_surfxml_platform_cb_list, &routing_floyd_parse_end);
356 surfxml_add_callback(STag_surfxml_route_cb_list,
357 &routing_full_parse_Sroute_set_endpoints);
358 surfxml_add_callback(ETag_surfxml_route_cb_list, &routing_full_parse_Eroute);
362 /* ************************************************************************** */
363 /* ********** Dijkstra & Dijkstra Cached ROUTING **************************** */
365 s_routing_t generic_routing;
366 xbt_graph_t route_graph;
367 xbt_set_t graph_node_map;
368 xbt_set_t route_cache;
372 } s_routing_dijkstra_t,*routing_dijkstra_t;
375 typedef struct graph_node_data {
377 int graph_id; //used for caching internal id's
378 } s_graph_node_data_t, * graph_node_data_t;
380 typedef struct graph_node_map_element {
384 } s_graph_node_map_element_t, * graph_node_map_element_t;
386 typedef struct route_cache_element {
391 } s_route_cache_element_t, * route_cache_element_t;
396 static void route_cache_elem_free(void *e) {
397 route_cache_element_t elm=(route_cache_element_t)e;
406 static void graph_node_map_elem_free(void *e) {
407 graph_node_map_element_t elm = (graph_node_map_element_t)e;
418 static xbt_node_t route_graph_new_node(int id, int graph_id) {
419 routing_dijkstra_t routing = (routing_dijkstra_t) used_routing;
421 graph_node_data_t data = xbt_new0(struct graph_node_data, sizeof(struct graph_node_data));
423 data->graph_id = graph_id;
424 xbt_node_t node = xbt_graph_new_node(routing->route_graph, data);
426 graph_node_map_element_t elm = xbt_new0(struct graph_node_map_element, sizeof(struct graph_node_map_element));
428 elm->name = bprintf("%d",id);
431 xbt_set_add(routing->graph_node_map, (xbt_set_elm_t)elm, &graph_node_map_elem_free);
436 static graph_node_map_element_t graph_node_map_search(int id) {
437 routing_dijkstra_t routing = (routing_dijkstra_t) used_routing;
439 char * id_str = bprintf("%d",id);
440 graph_node_map_element_t elm = (graph_node_map_element_t)xbt_set_get_by_name_or_null(routing->graph_node_map, id_str);
449 static void route_new_dijkstra(int src_id, int dst_id, void* link) {
450 routing_dijkstra_t routing = (routing_dijkstra_t) used_routing;
452 xbt_node_t src = NULL;
453 xbt_node_t dst = NULL;
454 char * src_id_str = bprintf("%d",src_id);
455 char * dst_id_str = bprintf("%d",dst_id);
456 graph_node_map_element_t src_elm = (graph_node_map_element_t)xbt_set_get_by_name_or_null(routing->graph_node_map, src_id_str);
457 graph_node_map_element_t dst_elm = (graph_node_map_element_t)xbt_set_get_by_name_or_null(routing->graph_node_map, dst_id_str);
467 //add nodes if they don't exist in the graph
468 if(src_id == dst_id && src == NULL && dst == NULL) {
469 src = route_graph_new_node(src_id, -1);
473 src = route_graph_new_node(src_id, -1);
477 dst = route_graph_new_node(dst_id, -1);
481 //add link as edge to graph
482 xbt_graph_new_edge(routing->route_graph, src, dst, link);
486 static void add_loopback_dijkstra(void) {
487 routing_dijkstra_t routing = (routing_dijkstra_t) used_routing;
489 xbt_dynar_t nodes = xbt_graph_get_nodes(routing->route_graph);
491 xbt_node_t node = NULL;
492 unsigned int cursor2;
493 xbt_dynar_foreach(nodes, cursor2, node) {
494 xbt_dynar_t out_edges = xbt_graph_node_get_outedges(node);
495 xbt_edge_t edge = NULL;
499 xbt_dynar_foreach(out_edges, cursor, edge) {
500 xbt_node_t other_node = xbt_graph_edge_get_target(edge);
501 if(other_node == node) {
508 xbt_graph_new_edge(routing->route_graph, node, node, &routing->loopback);
512 static void routing_dijkstra_parse_end(void) {
513 routing_dijkstra_t routing = (routing_dijkstra_t) used_routing;
515 unsigned int cpt = 0;
516 xbt_dict_cursor_t cursor = NULL;
517 char *key, *data, *end;
518 const char *sep = "#";
519 xbt_dynar_t links, keys;
520 char *link_name = NULL;
522 /* Create the topology graph */
523 routing->route_graph = xbt_graph_new_graph(1, NULL);
524 routing->graph_node_map = xbt_set_new();
526 routing->route_cache = xbt_set_new();
529 /* Put the routes in position */
530 xbt_dict_foreach(route_table, cursor, key, data) {
532 links = (xbt_dynar_t) data;
533 keys = xbt_str_split_str(key, sep);
535 src_id = strtol(xbt_dynar_get_as(keys, 0, char *), &end, 16);
536 dst_id = strtol(xbt_dynar_get_as(keys, 1, char *), &end, 16);
537 xbt_dynar_free(&keys);
539 DEBUG4("Handle %d %d (from %d hosts): %ld links",
540 src_id,dst_id,routing->generic_routing.host_count,xbt_dynar_length(links));
542 xbt_assert3(xbt_dynar_length(links) == 1, "%ld links in route between host %d and %d, should be 1", xbt_dynar_length(links), src_id, dst_id);
544 xbt_dynar_foreach(links, cpt, link_name) {
545 void* link = xbt_dict_get_or_null(surf_network_model->resource_set, link_name);
547 route_new_dijkstra(src_id,dst_id,link);
549 THROW1(mismatch_error,0,"Link %s not found", link_name);
554 /* Add the loopback if needed */
555 add_loopback_dijkstra();
557 /* initialize graph indexes in nodes after graph has been built */
558 xbt_dynar_t nodes = xbt_graph_get_nodes(routing->route_graph);
560 xbt_node_t node = NULL;
561 unsigned int cursor2;
562 xbt_dynar_foreach(nodes, cursor2, node) {
563 graph_node_data_t data = xbt_graph_node_get_data(node);
564 data->graph_id = cursor2;
572 static xbt_dynar_t routing_dijkstra_get_route(int src_id,int dst_id) {
574 routing_dijkstra_t routing = (routing_dijkstra_t) used_routing;
575 int * pred_arr = NULL;
577 xbt_dynar_t nodes = xbt_graph_get_nodes(routing->route_graph);
579 /*Use the graph_node id mapping set to quickly find the nodes */
580 graph_node_map_element_t src_elm = graph_node_map_search(src_id);
581 graph_node_map_element_t dst_elm = graph_node_map_search(dst_id);
582 xbt_assert2(src_elm != NULL && dst_elm != NULL, "src %d or dst %d does not exist", src_id, dst_id);
583 int src_node_id = ((graph_node_data_t)xbt_graph_node_get_data(src_elm->node))->graph_id;
584 int dst_node_id = ((graph_node_data_t)xbt_graph_node_get_data(dst_elm->node))->graph_id;
586 route_cache_element_t elm = NULL;
587 if(routing->cached) {
588 /*check if there is a cached predecessor list avail */
589 char * src_id_str = bprintf("%d",src_id);
590 elm = (route_cache_element_t)xbt_set_get_by_name_or_null(routing->route_cache, src_id_str);
594 if(elm) { //cached mode and cache hit
595 pred_arr = elm->pred_arr;
596 } else { //not cached mode or cache miss
597 double * cost_arr = NULL;
598 xbt_heap_t pqueue = NULL;
601 int nr_nodes = xbt_dynar_length(nodes);
602 cost_arr = xbt_new0(double, nr_nodes); //link cost from src to other hosts
603 pred_arr = xbt_new0(int, nr_nodes); //predecessors in path from src
604 pqueue = xbt_heap_new(nr_nodes, free);
607 cost_arr[src_node_id] = 0.0;
609 for(i = 0; i < nr_nodes; i++) {
610 if(i != src_node_id) {
611 cost_arr[i] = DBL_MAX;
616 //initialize priority queue
617 int * nodeid = xbt_new0(int, 1);
619 xbt_heap_push(pqueue, nodeid, cost_arr[i]);
623 // apply dijkstra using the indexes from the graph's node array
624 while(xbt_heap_size(pqueue) > 0) {
625 int * v_id = xbt_heap_pop(pqueue);
626 xbt_node_t v_node = xbt_dynar_get_as(nodes, *v_id, xbt_node_t);
627 xbt_dynar_t out_edges = xbt_graph_node_get_outedges(v_node);
628 xbt_edge_t edge = NULL;
631 xbt_dynar_foreach(out_edges, cursor, edge) {
632 xbt_node_t u_node = xbt_graph_edge_get_target(edge);
633 graph_node_data_t data = xbt_graph_node_get_data(u_node);
634 int u_id = data->graph_id;
635 int cost_v_u = 1; //fixed link cost for now
637 if(cost_v_u + cost_arr[*v_id] < cost_arr[u_id]) {
638 pred_arr[u_id] = *v_id;
639 cost_arr[u_id] = cost_v_u + cost_arr[*v_id];
640 int * nodeid = xbt_new0(int, 1);
642 xbt_heap_push(pqueue, nodeid, cost_arr[u_id]);
646 //free item popped from pqueue
651 xbt_heap_free(pqueue);
655 //compose route path with links
656 xbt_dynar_t link_list = xbt_dynar_new(routing->size_of_link, NULL);
660 for(v = dst_node_id; v != src_node_id; v = pred_arr[v]) {
661 xbt_node_t node_pred_v = xbt_dynar_get_as(nodes, pred_arr[v], xbt_node_t);
662 xbt_node_t node_v = xbt_dynar_get_as(nodes, v, xbt_node_t);
663 xbt_edge_t edge = xbt_graph_get_edge(routing->route_graph, node_pred_v, node_v);
665 xbt_assert2(edge != NULL, "no route between host %d and %d", src_id, dst_id);
667 void * link = xbt_graph_edge_get_data(edge);
668 xbt_dynar_unshift(link_list, &link);
673 if(routing->cached && elm == NULL) {
674 //add to predecessor list of the current src-host to cache
675 elm = xbt_new0(struct route_cache_element, sizeof(struct route_cache_element));
676 elm->name = bprintf("%d",src_id);
678 elm->pred_arr = pred_arr;
680 xbt_set_add(routing->route_cache, (xbt_set_elm_t)elm, &route_cache_elem_free);
689 static void routing_dijkstra_finalize_route(xbt_dynar_t route) {
690 xbt_dynar_free(&route);
693 static void routing_dijkstra_finalize(void) {
694 routing_dijkstra_t routing = (routing_dijkstra_t)used_routing;
697 xbt_graph_free_graph(routing->route_graph, &free, NULL, &free);
698 xbt_set_free(&routing->graph_node_map);
700 xbt_set_free(&routing->route_cache);
701 xbt_dict_free(&used_routing->host_id);
710 static void routing_model_dijkstraboth_create(size_t size_of_link,void *loopback, int cached) {
711 /* initialize our structure */
712 routing_dijkstra_t routing = xbt_new0(s_routing_dijkstra_t,1);
713 routing->generic_routing.name = "Dijkstra";
714 routing->generic_routing.host_count = 0;
715 routing->generic_routing.get_route = routing_dijkstra_get_route;
716 routing->generic_routing.finalize = routing_dijkstra_finalize;
717 routing->generic_routing.finalize_route = routing_dijkstra_finalize_route;
718 routing->size_of_link = size_of_link;
719 routing->loopback = loopback;
720 routing->cached = cached;
722 /* Set it in position */
723 used_routing = (routing_t) routing;
725 /* Setup the parsing callbacks we need */
726 routing->generic_routing.host_id = xbt_dict_new();
727 surfxml_add_callback(STag_surfxml_host_cb_list, &routing_full_parse_Shost);
728 surfxml_add_callback(ETag_surfxml_platform_cb_list, &routing_dijkstra_parse_end);
729 surfxml_add_callback(STag_surfxml_route_cb_list,
730 &routing_full_parse_Sroute_set_endpoints);
731 surfxml_add_callback(ETag_surfxml_route_cb_list, &routing_full_parse_Eroute);
734 static void routing_model_dijkstra_create(size_t size_of_link,void *loopback) {
735 routing_model_dijkstraboth_create(size_of_link, loopback, 0);
738 static void routing_model_dijkstracache_create(size_t size_of_link,void *loopback) {
739 routing_model_dijkstraboth_create(size_of_link, loopback, 1);