Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
* Moving things around (private->public)
[simgrid.git] / src / surf / workstation.c
index 352b760..a552aa1 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "xbt/ex.h"
 #include "xbt/dict.h"
+#include "gras_config.h"
 #include "workstation_private.h"
 #include "cpu_private.h"
 #include "network_private.h"
@@ -296,6 +297,16 @@ static double get_available_speed(void *workstation)
       get_available_speed(((workstation_CLM03_t) workstation)->cpu);
 }
 
+static surf_action_t execute_parallel_task_bogus (int workstation_nb,
+                                           void **workstation_list,
+                                           double *computation_amount,
+                                           double *communication_amount,
+                                           double amount,
+                                           double rate)
+{
+  DIE_IMPOSSIBLE;
+}
+
 static surf_action_t execute_parallel_task (int workstation_nb,
                                            void **workstation_list,
                                            double *computation_amount,
@@ -491,7 +502,7 @@ static void surf_workstation_resource_init_internal(void)
   surf_workstation_resource->extension_public->get_available_speed = get_available_speed;
   surf_workstation_resource->extension_public->communicate = communicate;
   surf_workstation_resource->extension_public->execute_parallel_task = 
-    execute_parallel_task;
+    execute_parallel_task_bogus;
   surf_workstation_resource->extension_public->get_route = get_route;
   surf_workstation_resource->extension_public->get_route_size = get_route_size;
   surf_workstation_resource->extension_public->get_link_name = get_link_name;
@@ -515,24 +526,31 @@ static void surf_workstation_resource_init_internal(void)
 /* } */
 void surf_workstation_resource_init_CLM03(const char *filename)
 {
-/*   int i ; */
-/*   surf_resource_t resource =  NULL; */
-
   surf_workstation_resource_init_internal();
   surf_cpu_resource_init_Cas01(filename);
   surf_network_resource_init_CM02(filename);
   create_workstations();
   xbt_dynar_push(resource_list, &surf_workstation_resource);
-/*   xbt_dynar_foreach(resource_list, i, resource) { */
-/*     if(resource==surf_cpu_resource) { */
-/*       xbt_dynar_remove_at(resource_list, i, NULL); */
-/*       i--;  */
-/*       continue; */
-/*     } */
-/*     if(resource==surf_network_resource) { */
-/*       xbt_dynar_remove_at(resource_list, i, NULL); */
-/*       i--;  */
-/*       continue; */
-/*     } */
-/*   } */
+}
+
+#ifdef USE_GTNETS
+/* KF. Use GTNetS for the network. */
+void surf_workstation_resource_init_GTNETS(const char *filename)
+{
+  surf_workstation_resource_init_internal();
+  surf_cpu_resource_init_Cas01(filename);
+  surf_network_resource_init_GTNETS(filename);
+  create_workstations();
+  xbt_dynar_push(resource_list, &surf_workstation_resource);
+}
+#endif
+
+void surf_workstation_resource_init_compound(const char *filename)
+{
+
+  xbt_assert0(surf_cpu_resource,"No CPU resource defined yet!");
+  xbt_assert0(surf_network_resource,"No network resource defined yet!");
+  surf_workstation_resource_init_internal();
+  create_workstations();
+  xbt_dynar_push(resource_list, &surf_workstation_resource);
 }