A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New XBT module: file
[simgrid.git]
/
src
/
surf
/
surf_routing_cluster.cpp
diff --git
a/src/surf/surf_routing_cluster.cpp
b/src/surf/surf_routing_cluster.cpp
index
02c11ba
..
8ee2f55
100644
(file)
--- a/
src/surf/surf_routing_cluster.cpp
+++ b/
src/surf/surf_routing_cluster.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2009-2011, 2013-201
4
. The SimGrid Team.
+/* Copyright (c) 2009-2011, 2013-201
5
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-29,7
+29,7
@@
AsCluster::AsCluster() : AsNone()
}
/* Business methods */
}
/* Business methods */
-void AsCluster::getRouteAndLatency(RoutingEdge
Ptr src, RoutingEdgePtr
dst, sg_platf_route_cbarg_t route, double *lat)
+void AsCluster::getRouteAndLatency(RoutingEdge
*src, RoutingEdge *
dst, sg_platf_route_cbarg_t route, double *lat)
{
s_surf_parsing_link_up_down_t info;
XBT_VERB("cluster_get_route_and_latency from '%s'[%d] to '%s'[%d]",
{
s_surf_parsing_link_up_down_t info;
XBT_VERB("cluster_get_route_and_latency from '%s'[%d] to '%s'[%d]",
@@
-41,7
+41,7
@@
void AsCluster::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_pl
info = xbt_dynar_get_as(p_linkUpDownList, src->getId() * p_nb_links_per_node, s_surf_parsing_link_up_down_t);
xbt_dynar_push_as(route->link_list, void *, info.link_up);
if (lat)
info = xbt_dynar_get_as(p_linkUpDownList, src->getId() * p_nb_links_per_node, s_surf_parsing_link_up_down_t);
xbt_dynar_push_as(route->link_list, void *, info.link_up);
if (lat)
- *lat += static_cast<
NetworkLinkPtr
>(info.link_up)->getLatency();
+ *lat += static_cast<
Link*
>(info.link_up)->getLatency();
return;
}
return;
}
@@
-55,13
+55,13
@@
void AsCluster::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_pl
if (info.link_up) { // link up
xbt_dynar_push_as(route->link_list, void *, info.link_up);
if (lat)
if (info.link_up) { // link up
xbt_dynar_push_as(route->link_list, void *, info.link_up);
if (lat)
- *lat += static_cast<
NetworkLinkPtr
>(info.link_up)->getLatency();
+ *lat += static_cast<
Link*
>(info.link_up)->getLatency();
}
}
if (p_backbone) {
}
}
if (p_backbone) {
- xbt_dynar_push_as(route->link_list, void *, static_cast<Resource
Ptr
>(p_backbone));
+ xbt_dynar_push_as(route->link_list, void *, static_cast<Resource
*
>(p_backbone));
if (lat)
*lat += p_backbone->getLatency();
}
if (lat)
*lat += p_backbone->getLatency();
}
@@
-72,7
+72,7
@@
void AsCluster::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_pl
if (info.link_down) { // link down
xbt_dynar_push_as(route->link_list, void *, info.link_down);
if (lat)
if (info.link_down) { // link down
xbt_dynar_push_as(route->link_list, void *, info.link_down);
if (lat)
- *lat += static_cast<
NetworkLinkPtr
>(info.link_down)->getLatency();
+ *lat += static_cast<
Link*
>(info.link_down)->getLatency();
}
if (p_has_limiter){ // limiter for receiver
info = xbt_dynar_get_as(p_linkUpDownList, dst->getId() * p_nb_links_per_node + p_has_loopback, s_surf_parsing_link_up_down_t);
}
if (p_has_limiter){ // limiter for receiver
info = xbt_dynar_get_as(p_linkUpDownList, dst->getId() * p_nb_links_per_node + p_has_loopback, s_surf_parsing_link_up_down_t);
@@
-86,7
+86,7
@@
void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
int isrc;
int table_size = xbt_dynar_length(p_indexNetworkElm);
int isrc;
int table_size = xbt_dynar_length(p_indexNetworkElm);
- RoutingEdge
Ptr
src;
+ RoutingEdge
*
src;
xbt_node_t current, previous, backboneNode = NULL, routerNode;
s_surf_parsing_link_up_down_t info;
xbt_node_t current, previous, backboneNode = NULL, routerNode;
s_surf_parsing_link_up_down_t info;
@@
-104,7
+104,7
@@
void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
}
for (isrc = 0; isrc < table_size; isrc++) {
}
for (isrc = 0; isrc < table_size; isrc++) {
- src = xbt_dynar_get_as(p_indexNetworkElm, isrc, RoutingEdge
Ptr
);
+ src = xbt_dynar_get_as(p_indexNetworkElm, isrc, RoutingEdge
*
);
if (src->getRcType() != SURF_NETWORK_ELEMENT_ROUTER) {
previous = new_xbt_graph_node(graph, src->getName(), nodes);
if (src->getRcType() != SURF_NETWORK_ELEMENT_ROUTER) {
previous = new_xbt_graph_node(graph, src->getName(), nodes);
@@
-113,7
+113,7
@@
void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
if (info.link_up) { // link up
if (info.link_up) { // link up
- const char *link_name = static_cast<Resource
Ptr
>(info.link_up)->getName();
+ const char *link_name = static_cast<Resource
*
>(info.link_up)->getName();
current = new_xbt_graph_node(graph, link_name, nodes);
new_xbt_graph_edge(graph, previous, current, edges);
current = new_xbt_graph_node(graph, link_name, nodes);
new_xbt_graph_edge(graph, previous, current, edges);
@@
-126,7
+126,7
@@
void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
}
if (info.link_down) { // link down
}
if (info.link_down) { // link down
- const char *link_name = static_cast<Resource
Ptr
>(info.link_down)->getName();
+ const char *link_name = static_cast<Resource
*
>(info.link_down)->getName();
current = new_xbt_graph_node(graph, link_name, nodes);
new_xbt_graph_edge(graph, previous, current, edges);
current = new_xbt_graph_node(graph, link_name, nodes);
new_xbt_graph_edge(graph, previous, current, edges);
@@
-142,7
+142,7
@@
void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
}
void AsCluster::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int , int position){
}
void AsCluster::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int , int position){
- s_sg_platf_link_cbarg_t link;
+ s_sg_platf_link_cbarg_t link
= SG_PLATF_LINK_INITIALIZER
;
s_surf_parsing_link_up_down_t info;
char* link_id = bprintf("%s_link_%d", cluster->id, id);
s_surf_parsing_link_up_down_t info;
char* link_id = bprintf("%s_link_%d", cluster->id, id);
@@
-156,28
+156,28
@@
void AsCluster::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id,
if (link.policy == SURF_LINK_FULLDUPLEX) {
char *tmp_link = bprintf("%s_UP", link_id);
if (link.policy == SURF_LINK_FULLDUPLEX) {
char *tmp_link = bprintf("%s_UP", link_id);
- info.link_up =
xbt_lib_get_or_null(link_lib, tmp_link, SURF_LINK_LEVEL
);
+ info.link_up =
sg_link_by_name(tmp_link
);
xbt_free(tmp_link);
tmp_link = bprintf("%s_DOWN", link_id);
xbt_free(tmp_link);
tmp_link = bprintf("%s_DOWN", link_id);
- info.link_down =
xbt_lib_get_or_null(link_lib, tmp_link, SURF_LINK_LEVEL
);
+ info.link_down =
sg_link_by_name(tmp_link
);
xbt_free(tmp_link);
} else {
xbt_free(tmp_link);
} else {
- info.link_up =
xbt_lib_get_or_null(link_lib, link_id, SURF_LINK_LEVEL
);
+ info.link_up =
sg_link_by_name(link_id
);
info.link_down = info.link_up;
}
xbt_dynar_set(p_linkUpDownList, position, &info);
xbt_free(link_id);
}
info.link_down = info.link_up;
}
xbt_dynar_set(p_linkUpDownList, position, &info);
xbt_free(link_id);
}
-int AsCluster::parsePU(RoutingEdge
Ptr
elm) {
+int AsCluster::parsePU(RoutingEdge
*
elm) {
XBT_DEBUG("Load process unit \"%s\"", elm->getName());
XBT_DEBUG("Load process unit \"%s\"", elm->getName());
- xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge
Ptr
, elm);
+ xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge
*
, elm);
return xbt_dynar_length(p_indexNetworkElm)-1;
}
return xbt_dynar_length(p_indexNetworkElm)-1;
}
-int AsCluster::parseAS(RoutingEdge
Ptr
elm) {
+int AsCluster::parseAS(RoutingEdge
*
elm) {
XBT_DEBUG("Load Autonomous system \"%s\"", elm->getName());
XBT_DEBUG("Load Autonomous system \"%s\"", elm->getName());
- xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge
Ptr
, elm);
+ xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge
*
, elm);
return xbt_dynar_length(p_indexNetworkElm)-1;
}
return xbt_dynar_length(p_indexNetworkElm)-1;
}