// Symmetrical YES
if (route->symmetrical == true) {
- if (not route->gw_dst && not route->gw_src)
- XBT_DEBUG("Load Route from \"%s\" to \"%s\"", dstName, srcName);
- else
- XBT_DEBUG("Load NetzoneRoute from %s@%s to %s@%s", dstName, route->gw_dst->name().c_str(), srcName,
- route->gw_src->name().c_str());
xbt_dynar_t nodes = xbt_graph_get_nodes(routeGraph_);
xbt_node_t node_s_v = xbt_dynar_get_as(nodes, src->id(), xbt_node_t);
xbt_node_t node_e_v = xbt_dynar_get_as(nodes, dst->id(), xbt_node_t);
xbt_edge_t edge = xbt_graph_get_edge(routeGraph_, node_e_v, node_s_v);
- if (edge)
- THROWF(arg_error, 0, "Route from %s@%s to %s@%s already exists", dstName, route->gw_dst->name().c_str(), srcName,
+ if (not route->gw_dst || not route->gw_src){
+ XBT_DEBUG("Load Route from \"%s\" to \"%s\"", dstName, srcName);
+ if (edge)
+ THROWF(arg_error, 0, "Route from %s to %s already exists", dstName, srcName);
+ } else {
+ XBT_DEBUG("Load NetzoneRoute from %s@%s to %s@%s", dstName, route->gw_dst->name().c_str(), srcName,
+ route->gw_src->name().c_str());
+ if (edge)
+ THROWF(arg_error, 0, "Route from %s@%s to %s@%s already exists", dstName, route->gw_dst->name().c_str(), srcName,
route->gw_src->name().c_str());
+ }
if (route->gw_dst && route->gw_src) {
NetPoint* gw_tmp = route->gw_src;
route->gw_dst = gw_tmp;
}
- if (not route->gw_src && not route->gw_dst)
+ if (not route->gw_src || not route->gw_dst)
XBT_DEBUG("Load Route from \"%s\" to \"%s\"", route->dst->name().c_str(), route->src->name().c_str());
else
XBT_DEBUG("Load NetzoneRoute from \"%s(%s)\" to \"%s(%s)\"", route->dst->name().c_str(), route->gw_src->name().c_str(),
route->gw_src = route->gw_dst;
route->gw_dst = gw_tmp;
}
- if (route->gw_dst) // inter-zone route (to adapt the error message, if any)
+ if (route->gw_dst && route->gw_src) // inter-zone route (to adapt the error message, if any)
xbt_assert(
nullptr == TO_ROUTE_FULL(dst->id(), src->id()),
"The route between %s@%s and %s@%s already exists. You should not declare the reverse path as symmetrical.",
const char* srcName = src->cname();
const char* dstName = dst->cname();
- if (not route->gw_dst && not route->gw_src) {
+ if (not route->gw_dst || not route->gw_src) {
XBT_DEBUG("Load Route from \"%s\" to \"%s\"", srcName, dstName);
xbt_assert(src, "Cannot add a route from %s to %s: %s does not exist.", srcName, dstName, srcName);
xbt_assert(dst, "Cannot add a route from %s to %s: %s does not exist.", srcName, dstName, dstName);
if ((char *) ptr < (char *) mdp->heapbase || BLOCK(ptr) > mdp->heapsize) {
printf("FIXME. Ouch, this pointer is not mine, refusing to proceed (another solution would be to malloc "
"it instead of reallocing it, see source code)\n");
- result = mmalloc(mdp, size);
abort();
- return result;
}
size_t requested_size = size; // The amount of memory requested by user, for real