xbt_assert(info, "Host '%s' not found!", host->id);
xbt_assert(current_routing->p_modelDesc == &routing_models[SURF_MODEL_CLUSTER] ||
current_routing->p_modelDesc == &routing_models[SURF_MODEL_VIVALDI],
xbt_assert(info, "Host '%s' not found!", host->id);
xbt_assert(current_routing->p_modelDesc == &routing_models[SURF_MODEL_CLUSTER] ||
current_routing->p_modelDesc == &routing_models[SURF_MODEL_VIVALDI],
xbt_assert(!sg_host_by_name(host->id),
"Reading a host, processing unit \"%s\" already exists", host->id);
xbt_assert(!sg_host_by_name(host->id),
"Reading a host, processing unit \"%s\" already exists", host->id);
new_as->p_modelDesc = model;
new_as->p_hierarchy = SURF_ROUTING_NULL;
new_as->p_name = xbt_strdup(AS->id);
new_as->p_modelDesc = model;
new_as->p_hierarchy = SURF_ROUTING_NULL;
new_as->p_name = xbt_strdup(AS->id);
{
xbt_assert(src && dst, "bad parameters for \"elements_father\" method");
#define ELEMENTS_FATHER_MAXDEPTH 16 /* increase if it is not enough */
{
xbt_assert(src && dst, "bad parameters for \"elements_father\" method");
#define ELEMENTS_FATHER_MAXDEPTH 16 /* increase if it is not enough */
* This function is called by "get_route" and "get_latency". It allows to walk
* recursively through the ASes tree.
*/
* This function is called by "get_route" and "get_latency". It allows to walk
* recursively through the ASes tree.
*/
memset(&route,0,sizeof(route));
xbt_assert(src && dst, "bad parameters for \"_get_route_latency\" method");
XBT_DEBUG("Solve route/latency \"%s\" to \"%s\"", src->getName(), dst->getName());
/* Find how src and dst are interconnected */
memset(&route,0,sizeof(route));
xbt_assert(src && dst, "bad parameters for \"_get_route_latency\" method");
XBT_DEBUG("Solve route/latency \"%s\" to \"%s\"", src->getName(), dst->getName());
/* Find how src and dst are interconnected */
elements_father(src, dst, &common_father, &src_father, &dst_father);
XBT_DEBUG("elements_father: common father '%s' src_father '%s' dst_father '%s'",
common_father->p_name, src_father->p_name, dst_father->p_name);
elements_father(src, dst, &common_father, &src_father, &dst_father);
XBT_DEBUG("elements_father: common father '%s' src_father '%s' dst_father '%s'",
common_father->p_name, src_father->p_name, dst_father->p_name);
route.link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
// Find the net_card corresponding to father
route.link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
// Find the net_card corresponding to father
- RoutingEdgePtr src_father_net_elm = src_father->p_netElem;
- RoutingEdgePtr dst_father_net_elm = dst_father->p_netElem;
+ RoutingEdge *src_father_net_elm = src_father->p_netElem;
+ RoutingEdge *dst_father_net_elm = dst_father->p_netElem;
* walk through the routing components tree and find a route between hosts
* by calling the differents "get_route" functions in each routing component.
*/
* walk through the routing components tree and find a route between hosts
* by calling the differents "get_route" functions in each routing component.
*/
xbt_dynar_t* route, double *latency)
{
XBT_DEBUG("routing_get_route_and_latency from %s to %s", src->getName(), dst->getName());
xbt_dynar_t* route, double *latency)
{
XBT_DEBUG("routing_get_route_and_latency from %s to %s", src->getName(), dst->getName());
void routing_cluster_add_backbone(void* bb) {
xbt_assert(current_routing->p_modelDesc == &routing_models[SURF_MODEL_CLUSTER],
"You have to be in model Cluster to use tag backbone!");
void routing_cluster_add_backbone(void* bb) {
xbt_assert(current_routing->p_modelDesc == &routing_models[SURF_MODEL_CLUSTER],
"You have to be in model Cluster to use tag backbone!");
- xbt_assert(!surf_as_cluster_get_backbone(current_routing), "The backbone link is already defined!");
- surf_as_cluster_set_backbone(current_routing, bb);
+ xbt_assert(!static_cast<AsCluster*>(current_routing)->p_backbone, "The backbone link is already defined!");
+ static_cast<AsCluster*>(current_routing)->p_backbone = static_cast<Link*>(bb);
memset(&host, 0, sizeof(host));
host.initial_state = SURF_RESOURCE_ON;
host.pstate = 0;
host.power_scale = 1.0;
host.core_amount = 1;
memset(&host, 0, sizeof(host));
host.initial_state = SURF_RESOURCE_ON;
host.pstate = 0;
host.power_scale = 1.0;
host.core_amount = 1;
memset(&link, 0, sizeof(link));
link.state = SURF_RESOURCE_ON;
link.policy = SURF_LINK_FULLDUPLEX;
link.latency = cabinet->lat;
link.bandwidth = cabinet->bw;
memset(&link, 0, sizeof(link));
link.state = SURF_RESOURCE_ON;
link.policy = SURF_LINK_FULLDUPLEX;
link.latency = cabinet->lat;
link.bandwidth = cabinet->bw;
memset(&host_link, 0, sizeof(host_link));
for (i = start; i <= end; i++) {
memset(&host_link, 0, sizeof(host_link));
for (i = start; i <= end; i++) {
XBT_DEBUG("<AS id=\"%s\"\trouting=\"Torus_Cluster\">", cluster->id);
AS.routing = A_surfxml_AS_routing_Cluster___torus;
sg_platf_new_AS_begin(&AS);
XBT_DEBUG("<AS id=\"%s\"\trouting=\"Torus_Cluster\">", cluster->id);
AS.routing = A_surfxml_AS_routing_Cluster___torus;
sg_platf_new_AS_begin(&AS);
}
else if (cluster->topology == SURF_CLUSTER_FAT_TREE) {
XBT_DEBUG("<AS id=\"%s\"\trouting=\"Fat_Tree_Cluster\">", cluster->id);
}
else if (cluster->topology == SURF_CLUSTER_FAT_TREE) {
XBT_DEBUG("<AS id=\"%s\"\trouting=\"Fat_Tree_Cluster\">", cluster->id);
- ((AsClusterPtr)current_routing)->p_nb_links_per_node++;
- ((AsClusterPtr)current_routing)->p_has_loopback=1;
+ ((AsCluster*)current_routing)->p_nb_links_per_node++;
+ ((AsCluster*)current_routing)->p_has_loopback=1;
- ((AsClusterPtr)current_routing)->p_nb_links_per_node++;
- ((AsClusterPtr)current_routing)->p_has_limiter=1;
+ ((AsCluster*)current_routing)->p_nb_links_per_node++;
+ ((AsCluster*)current_routing)->p_has_limiter=1;
- xbt_dynar_set(current_routing->p_linkUpDownList, rankId*((AsClusterPtr)current_routing)->p_nb_links_per_node, &info_loop);
+ xbt_dynar_set(current_routing->p_linkUpDownList, rankId*(static_cast<AsCluster*>(current_routing))->p_nb_links_per_node, &info_loop);
info_lim.link_down = info_lim.link_up;
free(tmp_link);
xbt_dynar_set(current_routing->p_linkUpDownList,
info_lim.link_down = info_lim.link_up;
free(tmp_link);
xbt_dynar_set(current_routing->p_linkUpDownList,
- ((AsClusterPtr)current_routing)->create_links_for_node(cluster, i, rankId, rankId*
- ((AsClusterPtr)current_routing)->p_nb_links_per_node
- + ((AsClusterPtr)current_routing)->p_has_loopback
- + ((AsClusterPtr)current_routing)->p_has_limiter );
+ static_cast<AsCluster*>(current_routing)->create_links_for_node(cluster, i, rankId, rankId*
+ static_cast<AsCluster*>(current_routing)->p_nb_links_per_node
+ + static_cast<AsCluster*>(current_routing)->p_has_loopback
+ + static_cast<AsCluster*>(current_routing)->p_has_limiter );
// For fat trees, the links must be created once all nodes have been added
if(cluster->topology == SURF_CLUSTER_FAT_TREE) {
// For fat trees, the links must be created once all nodes have been added
if(cluster->topology == SURF_CLUSTER_FAT_TREE) {
}
// Add a router. It is magically used thanks to the way in which surf_routing_cluster is written,
// and it's very useful to connect clusters together
XBT_DEBUG(" ");
XBT_DEBUG("<router id=\"%s\"/>", cluster->router_id);
char *newid = NULL;
}
// Add a router. It is magically used thanks to the way in which surf_routing_cluster is written,
// and it's very useful to connect clusters together
XBT_DEBUG(" ");
XBT_DEBUG("<router id=\"%s\"/>", cluster->router_id);
char *newid = NULL;
memset(&router, 0, sizeof(router));
router.id = cluster->router_id;
router.coord = "";
memset(&router, 0, sizeof(router));
router.id = cluster->router_id;
router.coord = "";
bprintf("%s%s_router%s", cluster->prefix, cluster->id,
cluster->suffix);
sg_platf_new_router(&router);
bprintf("%s%s_router%s", cluster->prefix, cluster->id,
cluster->suffix);
sg_platf_new_router(&router);
- ((AsClusterPtr)current_routing)->p_router = (RoutingEdgePtr) xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL);
+ ((AsCluster*)current_routing)->p_router = (RoutingEdge*) xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL);
current_routing->p_linkUpDownList = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);
XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\"/>", host_id, peer->power);
current_routing->p_linkUpDownList = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);
XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\"/>", host_id, peer->power);
memset(&host, 0, sizeof(host));
host.initial_state = SURF_RESOURCE_ON;
host.id = host_id;
memset(&host, 0, sizeof(host));
host.initial_state = SURF_RESOURCE_ON;
host.id = host_id;
memset(&link, 0, sizeof(link));
link.state = SURF_RESOURCE_ON;
link.policy = SURF_LINK_SHARED;
memset(&link, 0, sizeof(link));
link.state = SURF_RESOURCE_ON;
link.policy = SURF_LINK_SHARED;
sg_platf_new_link(&link);
XBT_DEBUG("<host_link\tid=\"%s\"\tup=\"%s\"\tdown=\"%s\" />", host_id,link_up,link_down);
sg_platf_new_link(&link);
XBT_DEBUG("<host_link\tid=\"%s\"\tup=\"%s\"\tdown=\"%s\" />", host_id,link_up,link_down);
memset(&host_link, 0, sizeof(host_link));
host_link.id = host_id;
host_link.link_up = link_up;
memset(&host_link, 0, sizeof(host_link));
host_link.id = host_id;
host_link.link_up = link_up;
sg_platf_new_host_link(&host_link);
XBT_DEBUG("<router id=\"%s\"/>", router_id);
sg_platf_new_host_link(&host_link);
XBT_DEBUG("<router id=\"%s\"/>", router_id);
memset(&router, 0, sizeof(router));
router.id = router_id;
router.coord = peer->coord;
sg_platf_new_router(&router);
memset(&router, 0, sizeof(router));
router.id = router_id;
router.coord = peer->coord;
sg_platf_new_router(&router);
- static_cast<AsClusterPtr>(current_routing)->p_router = static_cast<RoutingEdgePtr>(xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL));
+ static_cast<AsCluster*>(current_routing)->p_router = static_cast<RoutingEdge*>(xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL));
xbt_lib_foreach(storage_lib, cursor, key, data) {
if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) {
xbt_lib_foreach(storage_lib, cursor, key, data) {
if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) {
- StoragePtr storage = static_cast<StoragePtr>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
+ Storage *storage = static_cast<Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
host_elm = sg_routing_edge_by_name_or_null(storage->p_attach);
if(!host_elm)
surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach);
host_elm = sg_routing_edge_by_name_or_null(storage->p_attach);
if(!host_elm)
surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach);
* This fuction is call by "finalize". It allow to finalize the
* AS or routing components. It delete all the structures.
*/
* This fuction is call by "finalize". It allow to finalize the
* AS or routing components. It delete all the structures.
*/
-AsPtr surf_AS_get_by_name(const char * name) {
- AsPtr as = surf_AS_recursive_get_by_name(routing_platf->p_root, name);
+As *surf_AS_get_by_name(const char * name) {
+ As *as = surf_AS_recursive_get_by_name(routing_platf->p_root, name);
int count = xbt_dynar_length(elms);
xbt_dynar_t res = xbt_dynar_new(sizeof(xbt_dictelm_t), NULL);
for (index = 0; index < count; index++) {
int count = xbt_dynar_length(elms);
xbt_dynar_t res = xbt_dynar_new(sizeof(xbt_dictelm_t), NULL);
for (index = 0; index < count; index++) {
delm = xbt_lib_get_elm_or_null(host_lib, relm->getName());
if (delm!=NULL) {
xbt_dynar_push(res, &delm);
delm = xbt_lib_get_elm_or_null(host_lib, relm->getName());
if (delm!=NULL) {
xbt_dynar_push(res, &delm);