int SIMIX_HOST_LEVEL; //Simix level
int MSG_HOST_LEVEL; //Msg level
int SD_HOST_LEVEL; //Simdag level
-int COORD_HOST_LEVEL; //Coordinates level
+int COORD_HOST_LEVEL=0; //Coordinates level
int NS3_HOST_LEVEL; //host node for ns3
xbt_lib_t link_lib;
if (host->coord && strcmp(host->coord, "")) {
if (!COORD_HOST_LEVEL)
xbt_die
- ("To use coordinates, you must set configuration 'coordinates' to 'yes'");
+ ("To use host coordinates, please add --cfg=coordinates:yes to your command line");
xbt_dynar_t ctn = xbt_str_split_str(host->coord, " ");
xbt_dynar_shrink(ctn, 0);
xbt_lib_set(host_lib, host->id, COORD_HOST_LEVEL, (void *) ctn);
*/
static void routing_parse_E_route(void)
{
- route_extended_t route = xbt_new0(s_route_extended_t, 1);
- route->generic_route.link_list = link_list;
+ route_t route = xbt_new0(s_route_t, 1);
+ route->link_list = link_list;
xbt_assert(current_routing->parse_route,
"no defined method \"set_route\" in \"%s\"",
current_routing->name);
*/
static void routing_parse_E_ASroute(void)
{
- route_extended_t e_route = xbt_new0(s_route_extended_t, 1);
- e_route->generic_route.link_list = link_list;
+ route_t e_route = xbt_new0(s_route_t, 1);
+ e_route->link_list = link_list;
e_route->src_gateway = xbt_strdup(gw_src);
e_route->dst_gateway = xbt_strdup(gw_dst);
xbt_assert(current_routing->parse_ASroute,
*/
static void routing_parse_E_bypassRoute(void)
{
- route_extended_t e_route = xbt_new0(s_route_extended_t, 1);
- e_route->generic_route.link_list = link_list;
+ route_t e_route = xbt_new0(s_route_t, 1);
+ e_route->link_list = link_list;
e_route->src_gateway = xbt_strdup(gw_src);
e_route->dst_gateway = xbt_strdup(gw_dst);
xbt_assert(current_routing->parse_bypassroute,
* This function is called by "get_route" and "get_latency". It allows to walk
* recursively through the routing components tree.
*/
-static void _get_route_latency(const char *src, const char *dst,
- xbt_dynar_t * route, double *latency)
+static void _get_route_and_latency(const char *src, const char *dst,
+ xbt_dynar_t * route, double *latency)
{
XBT_DEBUG("Solve route/latency \"%s\" to \"%s\"", src, dst);
xbt_assert(src && dst, "bad parameters for \"_get_route_latency\" method");
if (src_father == dst_father) { /* SURF_ROUTING_BASE */
- route_extended_t e_route = NULL;
+ route_t e_route = NULL;
if (route) {
e_route = common_father->get_route(common_father, src, dst);
xbt_assert(e_route, "no route between \"%s\" and \"%s\"", src, dst);
- *route = e_route->generic_route.link_list;
+ *route = e_route->link_list;
}
if (latency) {
*latency = common_father->get_latency(common_father, src, dst, e_route);
} else { /* SURF_ROUTING_RECURSIVE */
- route_extended_t e_route_bypass = NULL;
+ route_t e_route_bypass = NULL;
if (common_father->get_bypass_route)
e_route_bypass = common_father->get_bypass_route(common_father, src, dst);
xbt_assert(!latency || !e_route_bypass,
"Bypass cannot work yet with get_latency");
- route_extended_t e_route_cnt = e_route_bypass
+ route_t e_route_cnt = e_route_bypass
? e_route_bypass : common_father->get_route(common_father,
src_father->name,
dst_father->name);
double latency_src;
xbt_dynar_t route_src;
- _get_route_latency(src, e_route_cnt->src_gateway,
+ _get_route_and_latency(src, e_route_cnt->src_gateway,
(route ? &route_src : NULL),
(latency ? &latency_src : NULL));
if (route) {
}
if (route) {
- xbt_dynar_foreach(e_route_cnt->generic_route.link_list, cpt, link) {
+ xbt_dynar_foreach(e_route_cnt->link_list, cpt, link) {
xbt_dynar_push(*route, &link);
}
}
double latency_dst;
xbt_dynar_t route_dst;
- _get_route_latency(e_route_cnt->dst_gateway, dst,
+ _get_route_and_latency(e_route_cnt->dst_gateway, dst,
(route ? &route_dst : NULL),
(latency ? &latency_dst : NULL));
if (route) {
}
}
- generic_free_extended_route(e_route_cnt);
+ generic_free_route(e_route_cnt);
}
}
{
static xbt_dynar_t last_route = NULL;
- _get_route_latency(src, dst, route, latency);
+ _get_route_and_latency(src, dst, route, latency);
xbt_assert(!route || *route, "no route between \"%s\" and \"%s\"", src, dst);
xbt_assert(!latency || *latency >= 0.0,
"latency error on route between \"%s\" and \"%s\"", src, dst);
random_id, random->min, random->max, random->mean, random->std,
random->generator, random->seed, random_radical);
- if (xbt_dict_size(random_value) == 0)
+ if (!random_value)
random_value = xbt_dict_new();
if (!strcmp(random_radical, "")) {