s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
unsigned int iter;
- int start, end, i;
- xbt_dynar_t radical_elements;
- xbt_dynar_t radical_ends;
if ((cluster->availability_trace && strcmp(cluster->availability_trace, ""))
|| (cluster->state_trace && strcmp(cluster->state_trace, ""))) {
}
- current_routing->p_linkUpDownList = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);
-
//Make all hosts
- radical_elements = xbt_str_split(cluster->radical, ",");
+ xbt_dynar_t radical_elements = xbt_str_split(cluster->radical, ",");
xbt_dynar_foreach(radical_elements, iter, groups) {
- radical_ends = xbt_str_split(groups, "-");
- start = surf_parse_get_int(xbt_dynar_get_as(radical_ends, 0, char *));
+ xbt_dynar_t radical_ends = xbt_str_split(groups, "-");
+ int start = surf_parse_get_int(xbt_dynar_get_as(radical_ends, 0, char *));
+ int end;
switch (xbt_dynar_length(radical_ends)) {
case 1:
surf_parse_error("Malformed radical");
break;
}
- for (i = start; i <= end; i++) {
+ for (int i = start; i <= end; i++) {
host_id = bprintf("%s%d%s", cluster->prefix, i, cluster->suffix);
link_id = bprintf("%s_link_%d", cluster->id, i);
xbt_assert(link_up_down.link_up, "Link '%s' not found!",netcard->link_up);
xbt_assert(link_up_down.link_down, "Link '%s' not found!",netcard->link_down);
- if(!current_routing->p_linkUpDownList)
- current_routing->p_linkUpDownList = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);
-
// If dynar is is greater than netcard id and if the host_link is already defined
if((int)xbt_dynar_length(current_routing->p_linkUpDownList) > info->getId() &&
xbt_dynar_get_as(current_routing->p_linkUpDownList, info->getId(), void*))
new_as->p_hierarchy = SURF_ROUTING_NULL;
new_as->p_name = xbt_strdup(AS->id);
- simgrid::surf::NetCard *info = new simgrid::surf::NetCardImpl(new_as->p_name, SURF_NETWORK_ELEMENT_AS, current_routing);
+ simgrid::surf::NetCard *netcard = new simgrid::surf::NetCardImpl(new_as->p_name, SURF_NETWORK_ELEMENT_AS, current_routing);
if (current_routing == NULL && routing_platf->p_root == NULL) {
/* it is the first one */
new_as->p_routingFather = NULL;
routing_platf->p_root = new_as;
- info->setId(-1);
+ netcard->setId(-1);
} else if (current_routing != NULL && routing_platf->p_root != NULL) {
xbt_assert(!xbt_dict_get_or_null
xbt_dict_set(current_routing->p_routingSons, AS->id,
(void *) new_as, NULL);
/* add to the father element list */
- info->setId(current_routing->parseAS(info));
+ netcard->setId(current_routing->parseAS(netcard));
} else {
THROWF(arg_error, 0, "All defined components must belong to a AS");
}
- xbt_lib_set(as_router_lib, info->getName(), ROUTING_ASR_LEVEL,
- (void *) info);
- XBT_DEBUG("Having set name '%s' id '%d'", new_as->p_name, info->getId());
+ xbt_lib_set(as_router_lib, netcard->getName(), ROUTING_ASR_LEVEL,
+ (void *) netcard);
+ XBT_DEBUG("Having set name '%s' id '%d'", new_as->p_name, netcard->getId());
/* set the new current component of the tree */
current_routing = new_as;
- current_routing->p_netcard = info;
+ current_routing->p_netcard = netcard;
- simgrid::surf::netcardCreatedCallbacks(info);
+ simgrid::surf::netcardCreatedCallbacks(netcard);
simgrid::surf::asCreatedCallbacks(new_as);
}
AS.routing = A_surfxml_AS_routing_Cluster;
sg_platf_new_AS_begin(&AS);
- 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->speed);
s_sg_platf_host_cbarg_t host = SG_PLATF_HOST_INITIALIZER;
memset(&host, 0, sizeof(host));
if(src->getRcType() == SURF_NETWORK_ELEMENT_HOST){
tmp_src_name = HOST_PEER(src->getName());
- if(p_linkUpDownList){
+ if ((int)xbt_dynar_length(p_linkUpDownList)>src->getId()) {
info = xbt_dynar_get_as(p_linkUpDownList, src->getId(), s_surf_parsing_link_up_down_t);
if(info.link_up) { // link up
xbt_dynar_push_as(route->link_list, void*, info.link_up);
if(dst->getRcType() == SURF_NETWORK_ELEMENT_HOST){
tmp_dst_name = HOST_PEER(dst->getName());
- if(p_linkUpDownList){
+ if ((int)xbt_dynar_length(p_linkUpDownList)>dst->getId()) {
info = xbt_dynar_get_as(p_linkUpDownList, dst->getId(), s_surf_parsing_link_up_down_t);
if(info.link_down) { // link down
xbt_dynar_push_as(route->link_list,void*,info.link_down);