Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Handle action whose latency is 0.
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 15 Mar 2008 20:42:38 +0000 (20:42 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 15 Mar 2008 20:42:38 +0000 (20:42 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5307 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/network_constant.c

index cf35b48..342fae9 100644 (file)
@@ -224,13 +224,19 @@ static surf_action_t communicate(void *src, void *dst, double size,
   action->generic_action.model_type =
       (surf_model_t) surf_network_model;
   action->suspended = 0;
   action->generic_action.model_type =
       (surf_model_t) surf_network_model;
   action->suspended = 0;
-  action->generic_action.state_set =
+
+  action->latency = random_generate(random_latency);
+  action->lat_init = action->latency;
+
+  if(action->latency<=0.0)
+    action->generic_action.state_set =
+      surf_network_model->common_public->states.done_action_set;
+  else
+    action->generic_action.state_set =
       surf_network_model->common_public->states.running_action_set;
 
   xbt_swag_insert(action, action->generic_action.state_set);
 
       surf_network_model->common_public->states.running_action_set;
 
   xbt_swag_insert(action, action->generic_action.state_set);
 
-  action->latency = random_generate(random_latency);
-  action->lat_init = action->latency;
 
   XBT_OUT;
 
 
   XBT_OUT;