Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
platform file is not hardcoded anymore
[simgrid.git] / testsuite / surf / surf_usage2.c
index 66c09fe..7c6c05d 100644 (file)
@@ -30,8 +30,8 @@ const char *string_action(e_surf_action_state_t state)
 }
 
 
-void test(void);
-void test(void)
+void test(char *platform);
+void test(char *platform)
 {
   void *workstationA = NULL;
   void *workstationB = NULL;
@@ -44,7 +44,7 @@ void test(void)
   e_surf_action_state_t stateActionC;
   double now = -1.0;
 
-  surf_workstation_resource_init("platform.txt");
+  surf_workstation_resource_init(platform);
 
   /*********************** WORKSTATION ***********************************/
   workstationA =
@@ -106,10 +106,13 @@ void test(void)
   surf_finalize();
 }
 
-
 int main(int argc, char **argv)
 {
   surf_init(&argc, argv);      /* Initialize some common structures */
-  test();
+  if(argc==1) {
+     fprintf(stderr,"Usage : %s platform.txt\n",argv[0]);
+     return 1;
+  }
+  test(argv[1]);
   return 0;
 }