Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a forwarder in the MSG example.
[simgrid.git] / testsuite / surf / surf_usage2.c
index 66c09fe..64a68ae 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;
 {
   void *workstationA = NULL;
   void *workstationB = NULL;
@@ -44,7 +44,7 @@ void test(void)
   e_surf_action_state_t stateActionC;
   double now = -1.0;
 
   e_surf_action_state_t stateActionC;
   double now = -1.0;
 
-  surf_workstation_resource_init("platform.txt");
+  surf_workstation_resource_init_CLM03(platform);
 
   /*********************** WORKSTATION ***********************************/
   workstationA =
 
   /*********************** WORKSTATION ***********************************/
   workstationA =
@@ -99,17 +99,20 @@ void test(void)
        resource->common_public->action_free(action);
       }
     }
        resource->common_public->action_free(action);
       }
     }
-  } while (surf_solve());
+  } while (surf_solve()>=0.0);
 
   printf("Simulation Terminated\n");
 
   surf_finalize();
 }
 
 
   printf("Simulation Terminated\n");
 
   surf_finalize();
 }
 
-
 int main(int argc, char **argv)
 {
   surf_init(&argc, argv);      /* Initialize some common structures */
 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;
 }
   return 0;
 }