Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Clean the communicate function.
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 15 Mar 2008 20:40:42 +0000 (20:40 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 15 Mar 2008 20:40:42 +0000 (20:40 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5299 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/network_constant.c

index 37a22b3..860f149 100644 (file)
@@ -548,23 +548,10 @@ static surf_action_t communicate(void *src, void *dst, double size,
                                 double rate)
 {
   surf_action_network_Constant_t action = NULL;
                                 double rate)
 {
   surf_action_network_Constant_t action = NULL;
-  /* LARGE PLATFORMS HACK:
-     Add a link_Constant_t *link and a int link_nb to network_card_Constant_t. It will represent local links for this node
-     Use the cluster_id for ->id */
   network_card_Constant_t card_src = src;
   network_card_Constant_t card_dst = dst;
   network_card_Constant_t card_src = src;
   network_card_Constant_t card_dst = dst;
-  int route_size = ROUTE_SIZE(card_src->id, card_dst->id);
-  link_Constant_t *route = ROUTE(card_src->id, card_dst->id);
-  /* LARGE PLATFORMS HACK:
-     total_route_size = route_size + src->link_nb + dst->nb */
-  int i;
 
   XBT_IN4("(%s,%s,%g,%g)", card_src->name, card_dst->name, size, rate);
 
   XBT_IN4("(%s,%s,%g,%g)", card_src->name, card_dst->name, size, rate);
-  /* LARGE PLATFORMS HACK:
-     assert on total_route_size */
-  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_Constant_t, 1);
 
 
   action = xbt_new0(s_surf_action_network_Constant_t, 1);
 
@@ -583,52 +570,9 @@ static surf_action_t communicate(void *src, void *dst, double size,
   xbt_swag_insert(action, action->generic_action.state_set);
   action->rate = rate;
 
   xbt_swag_insert(action, action->generic_action.state_set);
   action->rate = rate;
 
-  action->latency = 0.0;
-  for (i = 0; i < route_size; i++)
-    action->latency += route[i]->lat_current;
-  /* LARGE PLATFORMS HACK:
-     Add src->link and dst->link latencies */
+  action->latency = 1.0;
   action->lat_current = action->latency;
 
   action->lat_current = action->latency;
 
-  /* 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,
-                        route_size);
-  else
-    action->variable =
-       lmm_variable_new(network_maxmin_system, action, 1.0, -1.0,
-                        route_size);
-
-  if (action->rate < 0) {
-    if (action->lat_current > 0)
-      lmm_update_variable_bound(network_maxmin_system, action->variable,
-                               SG_TCP_CTE_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_CTE_GAMMA / (2.0 *
-                                                       action->
-                                                       lat_current)));
-    else
-      lmm_update_variable_bound(network_maxmin_system, action->variable,
-                               action->rate);
-  }
-  lmm_update_variable_latency(network_maxmin_system, action->variable,
-                             action->latency);
-
-  for (i = 0; i < route_size; i++)
-    lmm_expand(network_maxmin_system, route[i]->constraint,
-              action->variable, 1.0);
-  /* LARGE PLATFORMS HACK:
-     expand also with src->link and dst->link */
-
   XBT_OUT;
 
   return (surf_action_t) action;
   XBT_OUT;
 
   return (surf_action_t) action;