+ surf_action_network_CM02_t action = NULL;
+ /* LARGE PLATFORMS HACK:
+ Add a link_CM02_t *link and a int link_nb to network_card_CM02_t. It will represent local links for this node
+ Use the cluster_id for ->id */
+ xbt_dynar_t route = used_routing->get_route(src, dst);
+ /* LARGE PLATFORMS HACK:
+ total_route_size = route_size + src->link_nb + dst->nb */
+ unsigned int i;
+
+ XBT_IN4("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
+ /* LARGE PLATFORMS HACK:
+ assert on total_route_size */
+ xbt_assert2(xbt_dynar_length(route),
+ "You're trying to send data from %s to %s but there is no connection between these two hosts.",
+ src_name, dst_name);
+
+ link_CM02_t link;
+ int failed = 0;
+ xbt_dynar_foreach(route, i, link) {
+ if (link->lmm_resource.state_current == SURF_RESOURCE_OFF) {
+ failed = 1;
+ break;
+ }
+ }
+ action =
+ surf_action_new(sizeof(s_surf_action_network_CM02_t), size,
+ surf_network_model, failed);
+
+ xbt_swag_insert(action, action->generic_action.state_set);
+ action->rate = rate;
+
+ action->latency = 0.0;
+ action->weight = 0.0;
+ xbt_dynar_foreach(route, i, link) {
+ action->latency += link->lat_current;
+ action->weight +=
+ link->lat_current +
+ sg_weight_S_parameter /
+ (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
+ }
+ /* LARGE PLATFORMS HACK:
+ Add src->link and dst->link latencies */
+ action->lat_current = action->latency;
+ action->latency *= sg_latency_factor;
+
+ /* LARGE PLATFORMS HACK:
+ lmm_variable_new(..., total_route_size) */
+ if (action->latency > 0)
+ action->variable =
+ lmm_variable_new(network_maxmin_system, action, 0.0, -1.0,
+ xbt_dynar_length(route));
+ else
+ action->variable =
+ lmm_variable_new(network_maxmin_system, action, 1.0, -1.0,
+ xbt_dynar_length(route));
+
+ if (action->rate < 0) {
+ if (action->lat_current > 0)
+ lmm_update_variable_bound(network_maxmin_system, action->variable,
+ sg_tcp_gamma / (2.0 * action->lat_current));
+ else
+ lmm_update_variable_bound(network_maxmin_system, action->variable,
+ -1.0);
+ } else {
+ if (action->lat_current > 0)
+ lmm_update_variable_bound(network_maxmin_system, action->variable,
+ min(action->rate,
+ sg_tcp_gamma / (2.0 *
+ action->lat_current)));
+ else
+ lmm_update_variable_bound(network_maxmin_system, action->variable,
+ action->rate);
+ }
+
+ xbt_dynar_foreach(route, i, link) {
+ lmm_expand(network_maxmin_system, link->lmm_resource.constraint,
+ action->variable, 1.0);
+ }
+ /* LARGE PLATFORMS HACK:
+ expand also with src->link and dst->link */