Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Renamed resource initialization functions. Now they are postfixed by a alpha-style...
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 6 Jan 2005 21:52:21 +0000 (21:52 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 6 Jan 2005 21:52:21 +0000 (21:52 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@741 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/include/surf/surf.h
src/msg/deployment.c
src/msg/environment.c
src/surf/cpu.c
src/surf/network.c
src/surf/workstation.c
testsuite/surf/surf_usage.c
testsuite/surf/surf_usage2.c

index b54447c..2dbbc5d 100644 (file)
@@ -108,7 +108,7 @@ typedef struct surf_cpu_resource {
   surf_cpu_resource_extension_public_t extension_public;
 } s_surf_cpu_resource_t, *surf_cpu_resource_t;
 extern surf_cpu_resource_t surf_cpu_resource;
-void surf_cpu_resource_init(const char *filename);
+void surf_cpu_resource_init_Cas01(const char *filename);
 
 /* Network resource */
 typedef struct surf_network_resource_extension_private
@@ -125,7 +125,7 @@ typedef struct surf_network_resource {
 } s_surf_network_resource_t, *surf_network_resource_t;
 
 extern surf_network_resource_t surf_network_resource;
-void surf_network_resource_init(const char *filename);
+void surf_network_resource_init_CM02(const char *filename);
 
 /* Workstation resource */
 typedef struct surf_workstation_resource_extension_private
@@ -149,7 +149,8 @@ typedef struct surf_workstation_resource {
 } s_surf_workstation_resource_t, *surf_workstation_resource_t;
 
 extern surf_workstation_resource_t surf_workstation_resource;
-void surf_workstation_resource_init(const char *filename);
+void surf_workstation_resource_init_CLM03(const char *filename);
+void surf_workstation_resource_init_resource_init_KCCFLN05(const char *filename);
 extern xbt_dict_t workstation_set;
 
 /*******************************************/
index 50f5bba..c160d98 100644 (file)
@@ -59,7 +59,7 @@ void MSG_launch_application(const char *file)
   ETag_argument_fun = parse_argument;
   ETag_process_fun = parse_process_finalize;
   surf_parse_open(file);
-  xbt_assert1((!surf_parse_lex()),"Parse error in %s",file);
+  xbt_assert1((!surf_parse()),"Parse error in %s",file);
   surf_parse_close();
 }
 
index 981db97..1bb3d29 100644 (file)
@@ -64,7 +64,7 @@ void MSG_create_environment(const char *file) {
   char *name = NULL;
   void *workstation = NULL;
 
-  surf_workstation_resource_init(file);
+  surf_workstation_resource_init_CLM03(file);
 
   xbt_dict_foreach(workstation_set, cursor, name, workstation) {
     __MSG_host_create(name, workstation, NULL);
index 9c03c40..df379dd 100644 (file)
@@ -95,7 +95,7 @@ static void parse_file(const char *file)
   surf_parse_reset_parser();
   ETag_cpu_fun=parse_cpu;
   surf_parse_open(file);
-  xbt_assert1((!surf_parse_lex()),"Parse error in %s",file);
+  xbt_assert1((!surf_parse()),"Parse error in %s",file);
   surf_parse_close();
 }
 
@@ -365,7 +365,22 @@ static void surf_cpu_resource_init_internal(void)
   xbt_assert0(maxmin_system, "surf_init has to be called first!");
 }
 
-void surf_cpu_resource_init(const char *filename)
+/*********************************************************************/
+/* Basic sharing model for CPU: that is all this started... ;)       */
+/*********************************************************************/
+/* @InProceedings{casanova01simgrid, */
+/*   author =       "H. Casanova", */
+/*   booktitle =    "Proceedings of the IEEE Symposium on Cluster Computing */
+/*                  and the Grid (CCGrid'01)", */
+/*   publisher =    "IEEE Computer Society", */
+/*   title =        "Simgrid: {A} Toolkit for the Simulation of Application */
+/*                  Scheduling", */
+/*   year =         "2001", */
+/*   month =        may, */
+/*   note =         "Available at */
+/*                  \url{http://grail.sdsc.edu/papers/simgrid_ccgrid01.ps.gz}." */
+/* } */
+void surf_cpu_resource_init_Cas01(const char *filename)
 {
   if (surf_cpu_resource)
     return;
index 9e7dd9f..f5712f1 100644 (file)
@@ -166,14 +166,14 @@ static void parse_file(const char *file)
   surf_parse_reset_parser();
   ETag_network_link_fun=parse_network_link;
   surf_parse_open(file);
-  xbt_assert1((!surf_parse_lex()),"Parse error in %s",file);
+  xbt_assert1((!surf_parse()),"Parse error in %s",file);
   surf_parse_close();
 
   /* Figuring out the network cards used */
   surf_parse_reset_parser();
   STag_route_fun=parse_route_set_endpoints;
   surf_parse_open(file);
-  xbt_assert1((!surf_parse_lex()),"Parse error in %s",file);
+  xbt_assert1((!surf_parse()),"Parse error in %s",file);
   surf_parse_close();
 
   create_routing_table();
@@ -184,7 +184,7 @@ static void parse_file(const char *file)
   ETag_route_element_fun=parse_route_elem;
   ETag_route_fun=parse_route_set_route;
   surf_parse_open(file);
-  xbt_assert1((!surf_parse_lex()),"Parse error in %s",file);
+  xbt_assert1((!surf_parse()),"Parse error in %s",file);
   surf_parse_close();
 }
 
@@ -283,7 +283,7 @@ static void update_actions_state(double now, double delta)
     if (action->generic_action.max_duration != NO_MAX_DURATION)
       action->generic_action.max_duration -= delta;
 
-/*     if(action->generic_action.remains<.00001) action->generic_action.remains=0; */
+    /*   if(action->generic_action.remains<.00001) action->generic_action.remains=0; */
 
     if (action->generic_action.remains <= 0) {
       action->generic_action.finish = surf_get_clock();
@@ -322,10 +322,9 @@ static void update_resource_state(void *id,
                                  double value)
 {
   network_link_t nw_link = id;
-
-/*   printf("[" "%lg" "] Asking to update network card \"%s\" with value " */
-/*      "%lg" " for event %p\n", surf_get_clock(), nw_link->name, */
-/*      value, event_type); */
+  /*   printf("[" "%lg" "] Asking to update network card \"%s\" with value " */
+  /*    "%lg" " for event %p\n", surf_get_clock(), nw_link->name, */
+  /*    value, event_type); */
 
   if (event_type == nw_link->bw_event) {
     nw_link->bw_current = value;
@@ -442,7 +441,6 @@ static void surf_network_resource_init_internal(void)
       xbt_new0(s_surf_resource_private_t, 1);
   surf_network_resource->common_public =
       xbt_new0(s_surf_resource_public_t, 1);
-/*   surf_network_resource->extension_private = xbt_new0(s_surf_network_resource_extension_private_t,1); */
   surf_network_resource->extension_public =
       xbt_new0(s_surf_network_resource_extension_public_t, 1);
 
@@ -484,7 +482,18 @@ static void surf_network_resource_init_internal(void)
   xbt_assert0(maxmin_system, "surf_init has to be called first!");
 }
 
-void surf_network_resource_init(const char *filename)
+/***************************************************************************/
+/* The nice TCP sharing model designed by Loris Marchal and Henri Casanova */
+/***************************************************************************/
+/* @TechReport{      rr-lip2002-40, */
+/*   author        = {Henri Casanova and Loris Marchal}, */
+/*   institution   = {LIP}, */
+/*   title         = {A Network Model for Simulation of Grid Application}, */
+/*   number        = {2002-40}, */
+/*   month         = {oct}, */
+/*   year          = {2002} */
+/* } */
+void surf_network_resource_init_CM02(const char *filename)
 {
   if (surf_network_resource)
     return;
index 19cdad3..26d4602 100644 (file)
@@ -241,14 +241,25 @@ static void surf_workstation_resource_init_internal(void)
   xbt_assert0(maxmin_system, "surf_init has to be called first!");
 }
 
-void surf_workstation_resource_init(const char *filename)
+/********************************************************************/
+/* The model used in MSG and presented at CCGrid03                  */
+/********************************************************************/
+/* @InProceedings{Casanova.CLM_03, */
+/*   author = {Henri Casanova and Arnaud Legrand and Loris Marchal}, */
+/*   title = {Scheduling Distributed Applications: the SimGrid Simulation Framework}, */
+/*   booktitle = {Proceedings of the third IEEE International Symposium on Cluster Computing and the Grid (CCGrid'03)}, */
+/*   publisher = {"IEEE Computer Society Press"}, */
+/*   month = {may}, */
+/*   year = {2003} */
+/* } */
+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(filename);
-  surf_network_resource_init(filename);
+  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) { */
index d58b85a..5d4c577 100644 (file)
@@ -46,8 +46,8 @@ void test(char *platform)
   e_surf_action_state_t stateActionC;
   double now = -1.0;
 
-  surf_cpu_resource_init(platform);    /* Now it is possible to use CPUs */
-  surf_network_resource_init(platform);        /* Now it is possible to use eth0 */
+  surf_cpu_resource_init_Cas01(platform);      /* Now it is possible to use CPUs */
+  surf_network_resource_init_CM02(platform);   /* Now it is possible to use eth0 */
 
   /*********************** CPU ***********************************/
   printf("%p \n", surf_cpu_resource);
index be028d2..64a68ae 100644 (file)
@@ -44,7 +44,7 @@ void test(char *platform)
   e_surf_action_state_t stateActionC;
   double now = -1.0;
 
-  surf_workstation_resource_init(platform);
+  surf_workstation_resource_init_CLM03(platform);
 
   /*********************** WORKSTATION ***********************************/
   workstationA =