Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Let's compile SURF once in the afternoon and cleanup the mess I've set by changing...
[simgrid.git] / src / surf / network.c
index 412779c..202c2c6 100644 (file)
@@ -6,6 +6,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "network_private.h"
+#include "xbt/log.h"
 
 #define SG_TCP_CTE_GAMMA 20000.0
 
@@ -126,7 +127,7 @@ static void parse_network_link(void)
 
   xbt_assert0((A_network_link_state==A_network_link_state_ON)||
              (A_network_link_state==A_network_link_state_OFF),
-             "Invalid state")
+             "Invalid state");
   if (A_network_link_state==A_network_link_state_ON) 
     state_initial = SURF_NETWORK_LINK_ON;
   else if (A_network_link_state==A_network_link_state_OFF) 
@@ -400,6 +401,8 @@ static surf_action_t communicate(void *src, void *dst, double size, double rate)
   network_link_CM02_t *route = ROUTE(card_src->id, card_dst->id);
   int i;
 
+  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_CM02_t, 1);
 
   action->generic_action.using = 1;
@@ -447,10 +450,6 @@ static surf_action_t communicate(void *src, void *dst, double size, double rate)
   for (i = 0; i < route_size; i++)
     lmm_expand(maxmin_system, route[i]->constraint, action->variable, 1.0);
 
-  if(route_size == 0) {
-    action_change_state((surf_action_t) action, SURF_ACTION_DONE);
-  }
-
   return (surf_action_t) action;
 }