Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make SURF complain when you ask to perform a communication between two non-connected...
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 3 Oct 2005 15:43:30 +0000 (15:43 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 3 Oct 2005 15:43:30 +0000 (15:43 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1746 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/network.c
src/surf/network_dassf.c
src/surf/workstation_KCCFLN05.c

index 412779c..1f9f4c7 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
 
@@ -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;
 }
 
index 1b07eda..9d5d10f 100644 (file)
@@ -365,6 +365,8 @@ static surf_action_t communicate(void *src, void *dst, double size, double rate)
   network_link_DASSF_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_DASSF_t, 1);
 
   action->generic_action.using = 1;
index 58d5159..0221e7c 100644 (file)
@@ -472,6 +472,8 @@ static surf_action_t communicate_KCCFLN05(void *src, void *dst, double size,
   route_KCCFLN05_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_KCCFLN05_t, 1);
 
   action->generic_action.using = 1;