- network_card_GTNETS_t card_src = src;
- network_card_GTNETS_t card_dst = dst;
-/*
- int route_size = ROUTE_SIZE(card_src->id, card_dst->id);
- network_link_GTNETS_t *route = ROUTE(card_src->id, card_dst->id);
-*/
-
-/*
- xbt_assert2(route_size,"You're trying to send data from %s to %s but there is no connexion between these two cards.", card_src->name, card_dst->name);
-*/
-
- action = xbt_new0(s_surf_action_network_GTNETS_t, 1);
-
- action->generic_action.refcount = 1;
- action->generic_action.cost = size;
- action->generic_action.remains = size;
- /* Max durations are not supported */
- action->generic_action.max_duration = NO_MAX_DURATION;
- action->generic_action.start = surf_get_clock();
- action->generic_action.finish = -1.0;
- action->generic_action.model_type = surf_network_model;
-
- action->generic_action.state_set =
- surf_network_model->common_public.states.running_action_set;
-
- xbt_swag_insert(action, action->generic_action.state_set);
-
- /* KF: Add a flow to the GTNets Simulation, associated to this action */
- if (gtnets_create_flow(card_src->id, card_dst->id, size, (void *) action)
- < 0) {
- xbt_assert2(0, "Not route between host %s and host %s", card_src->generic_resource.name,
- card_dst->generic_resource.name);
+
+ xbt_assert0((src >= 0 && dst >= 0), "Either src or dst have invalid id (id<0)");
+
+ DEBUG4("Setting flow src %d \"%s\", dst %d \"%s\"", src, src_name, dst, dst_name);
+
+ xbt_dynar_t links = used_routing->get_route(src, dst);
+ route_new(src, dst, links, xbt_dynar_length(links));
+
+ action = surf_action_new(sizeof(s_surf_action_network_GTNETS_t), size, surf_network_model, 0);
+
+ /* Add a flow to the GTNets Simulation, associated to this action */
+ if (gtnets_create_flow(src, dst, size, (void *) action) < 0) {
+ xbt_assert2(0, "Not route between host %s and host %s", src_name,
+ dst_name);