Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove borland-compiler related cruft
[simgrid.git] / teshsuite / surf / surf_usage / surf_usage.c
index 45cb3ef..a276637 100644 (file)
@@ -6,14 +6,9 @@
 /* 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. */
 
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
 #include <stdio.h>
 #include "simgrid/sg_config.h"
 #include "surf/surf.h"
-#include "surf/surf_resource.h"
 #include "surf/surfxml_parse.h" // for reset callback
 
 #include "xbt/log.h"
@@ -42,10 +37,8 @@ const char *string_action(e_surf_action_state_t state)
 void test(char *platform);
 void test(char *platform)
 {
-  void *cpuA = NULL;
-  void *cpuB = NULL;
-  void *cardA = NULL;
-  void *cardB = NULL;
+  sg_host_t cpuA = NULL;
+  sg_host_t cpuB = NULL;
   surf_action_t actionA = NULL;
   surf_action_t actionB = NULL;
   surf_action_t actionC = NULL;
@@ -59,12 +52,12 @@ void test(char *platform)
 
   /*********************** CPU ***********************************/
   XBT_DEBUG("%p", surf_cpu_model_pm);
-  cpuA = surf_cpu_resource_by_name("Cpu A");
-  cpuB = surf_cpu_resource_by_name("Cpu B");
+  cpuA = sg_host_by_name("Cpu A");
+  cpuB = sg_host_by_name("Cpu B");
 
   /* Let's check that those two processors exist */
-  XBT_DEBUG("%s : %p", surf_resource_name(surf_cpu_resource_priv(cpuA)), cpuA);
-  XBT_DEBUG("%s : %p", surf_resource_name(surf_cpu_resource_priv(cpuB)), cpuB);
+  XBT_DEBUG("%s : %p", surf_cpu_name(sg_host_surfcpu(cpuA)), cpuA);
+  XBT_DEBUG("%s : %p", surf_cpu_name(sg_host_surfcpu(cpuB)), cpuB);
 
   /* Let's do something on it */
   actionA = surf_cpu_execute(cpuA, 1000.0);
@@ -83,15 +76,9 @@ void test(char *platform)
 
   /*********************** Network *******************************/
   XBT_DEBUG("%p", surf_network_model);
-  cardA = sg_routing_edge_by_name_or_null("Cpu A");
-  cardB = sg_routing_edge_by_name_or_null("Cpu B");
-
-  /* Let's check that those two processors exist */
-  XBT_DEBUG("%s : %p", surf_routing_edge_name(cardA), cardA);
-  XBT_DEBUG("%s : %p", surf_routing_edge_name(cardB), cardB);
 
   /* Let's do something on it */
-  surf_network_model_communicate(surf_network_model, cardA, cardB, 150.0, -1.0);
+  surf_network_model_communicate(surf_network_model, cpuA, cpuB, 150.0, -1.0);
 
   surf_solve(-1.0);                 /* Takes traces into account. Returns 0.0 */
   do {
@@ -128,10 +115,6 @@ void test(char *platform)
   XBT_DEBUG("Simulation Terminated");
 }
 
-#ifdef __BORLANDC__
-#pragma argsused
-#endif
-
 int main(int argc, char **argv)
 {
   surf_init(&argc, argv);       /* Initialize some common structures */