Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
I comment all the calls to used_routing, in order to use global routing.
[simgrid.git] / src / surf / network_constant.c
index 572ba02..7daaeb4 100644 (file)
@@ -1,6 +1,5 @@
-/*     $Id$     */
-
-/* Copyright (c) 2004 Arnaud Legrand. All rights reserved.                  */
+/* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -20,16 +19,15 @@ typedef struct surf_action_network_Constant {
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 static random_data_t random_latency = NULL;
-static int host_number = 0;
+static int host_number_int = 0;
 
 static void netcste_count_hosts(void)
 {
-  host_number++;
+  host_number_int++;
 }
 
 static void netcste_define_callbacks(const char *file)
 {
-  /* Figuring out the network links */
   surfxml_add_callback(STag_surfxml_host_cb_list, &netcste_count_hosts);
 }
 
@@ -54,16 +52,6 @@ static void netcste_action_cancel(surf_action_t action)
   return;
 }
 
-static void netcste_action_recycle(surf_action_t action)
-{
-  return;
-}
-
-static double netcste_action_get_remains(surf_action_t action)
-{
-  return action->remains;
-}
-
 static double netcste_share_resources(double now)
 {
   surf_action_network_Constant_t action = NULL;
@@ -185,11 +173,6 @@ static int netcste_action_is_suspended(surf_action_t action)
   return ((surf_action_network_Constant_t) action)->suspended;
 }
 
-static void netcste_action_set_max_duration(surf_action_t action, double duration)
-{
-  action->max_duration = duration;
-}
-
 static void netcste_finalize(void)
 {
   surf_model_exit(surf_network_model);
@@ -209,8 +192,9 @@ void surf_network_model_init_Constant(const char *filename)
   surf_network_model->name = "constant time network";
   surf_network_model->action_unref = netcste_action_unref;
   surf_network_model->action_cancel = netcste_action_cancel;
-  surf_network_model->action_recycle = netcste_action_recycle;
-  surf_network_model->get_remains = netcste_action_get_remains;
+  surf_network_model->action_recycle = net_action_recycle;
+  surf_network_model->get_remains = net_action_get_remains;
+  surf_network_model->get_latency_limited = net_get_link_latency;
 
   surf_network_model->model_private->resource_used = netcste_resource_used;
   surf_network_model->model_private->share_resources = netcste_share_resources;
@@ -223,7 +207,7 @@ void surf_network_model_init_Constant(const char *filename)
   surf_network_model->suspend = netcste_action_suspend;
   surf_network_model->resume = netcste_action_resume;
   surf_network_model->is_suspended = netcste_action_is_suspended;
-  surf_cpu_model->set_max_duration = netcste_action_set_max_duration;
+  surf_cpu_model->set_max_duration = net_action_set_max_duration;
 
   surf_network_model->extension.network.communicate = netcste_communicate;
   surf_network_model->extension.network.get_link_bandwidth =