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 / workstation.c
index b859aa3..b104f00 100644 (file)
@@ -1,6 +1,5 @@
-/*     $Id$     */
-
-/* Copyright (c) 2004 Arnaud Legrand. All rights reserved.                  */
+/* Copyright (c) 2004, 2005, 2006, 2007, 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. */
@@ -45,8 +44,9 @@ void create_workstations(void)
 
   xbt_dict_foreach(surf_model_resource_set(surf_cpu_model), cursor, name, cpu) {
     int *id = NULL;
-    if (used_routing && used_routing->host_id)
-      id = xbt_dict_get_or_null(used_routing->host_id,name);
+// COMMENTED BY DAVID
+//     if (used_routing && used_routing->host_id)
+//       id = xbt_dict_get_or_null(used_routing->host_id,name);
 
     workstation_new(name, cpu, id ? *id : 0);
   }
@@ -185,6 +185,14 @@ static void ws_action_set_priority(surf_action_t action, double priority)
     DIE_IMPOSSIBLE;
 }
 
+static int ws_get_latency_limited(surf_action_t action)
+{
+  if (action->model_type == surf_network_model)
+    return surf_network_model->get_latency_limited(action);
+  INFO0("You tried to ask if a non network action is limited by latency, aborting...");
+  DIE_IMPOSSIBLE;
+}
+
 static double ws_action_get_remains(surf_action_t action)
 {
   if (action->model_type == surf_network_model)
@@ -292,6 +300,7 @@ static void surf_workstation_model_init_internal(void)
   surf_workstation_model->set_max_duration = ws_action_set_max_duration;
   surf_workstation_model->set_priority = ws_action_set_priority;
   surf_workstation_model->get_remains = ws_action_get_remains;
+  surf_workstation_model->get_latency_limited = ws_get_latency_limited;
 
   surf_workstation_model->extension.workstation.execute = ws_execute;
   surf_workstation_model->extension.workstation.sleep = ws_action_sleep;
@@ -311,6 +320,7 @@ static void surf_workstation_model_init_internal(void)
   surf_workstation_model->extension.workstation.link_shared = ws_link_shared;
   surf_workstation_model->extension.workstation.get_properties =
     ws_get_properties;
+
 }
 
 /********************************************************************/