From: alegrand Date: Mon, 3 Oct 2005 15:43:30 +0000 (+0000) Subject: Make SURF complain when you ask to perform a communication between two non-connected... X-Git-Tag: v3.3~3611 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/39822aeb568b150222aaaab2b1896115acd3aeba Make SURF complain when you ask to perform a communication between two non-connected cards. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1746 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/surf/network.c b/src/surf/network.c index 412779c2c3..1f9f4c77be 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -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; } diff --git a/src/surf/network_dassf.c b/src/surf/network_dassf.c index 1b07edaea9..9d5d10f749 100644 --- a/src/surf/network_dassf.c +++ b/src/surf/network_dassf.c @@ -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; diff --git a/src/surf/workstation_KCCFLN05.c b/src/surf/workstation_KCCFLN05.c index 58d515991a..0221e7cea6 100644 --- a/src/surf/workstation_KCCFLN05.c +++ b/src/surf/workstation_KCCFLN05.c @@ -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;