From 9b9103db7f7aac95d28b162b7f78c6a946bba864 Mon Sep 17 00:00:00 2001 From: alegrand Date: Thu, 6 Jan 2005 21:52:21 +0000 Subject: [PATCH] Renamed resource initialization functions. Now they are postfixed by a alpha-style reference to the first paper where this model was described. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@741 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/include/surf/surf.h | 7 ++++--- src/msg/deployment.c | 2 +- src/msg/environment.c | 2 +- src/surf/cpu.c | 19 +++++++++++++++++-- src/surf/network.c | 29 +++++++++++++++++++---------- src/surf/workstation.c | 17 ++++++++++++++--- testsuite/surf/surf_usage.c | 4 ++-- testsuite/surf/surf_usage2.c | 2 +- 8 files changed, 59 insertions(+), 23 deletions(-) diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index b54447c286..2dbbc5d50c 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -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; /*******************************************/ diff --git a/src/msg/deployment.c b/src/msg/deployment.c index 50f5bbab80..c160d98550 100644 --- a/src/msg/deployment.c +++ b/src/msg/deployment.c @@ -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(); } diff --git a/src/msg/environment.c b/src/msg/environment.c index 981db9713a..1bb3d29ab9 100644 --- a/src/msg/environment.c +++ b/src/msg/environment.c @@ -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); diff --git a/src/surf/cpu.c b/src/surf/cpu.c index 9c03c4018f..df379ddcae 100644 --- a/src/surf/cpu.c +++ b/src/surf/cpu.c @@ -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; diff --git a/src/surf/network.c b/src/surf/network.c index 9e7dd9f053..f5712f1eed 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -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; diff --git a/src/surf/workstation.c b/src/surf/workstation.c index 19cdad3be0..26d4602048 100644 --- a/src/surf/workstation.c +++ b/src/surf/workstation.c @@ -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) { */ diff --git a/testsuite/surf/surf_usage.c b/testsuite/surf/surf_usage.c index d58b85ad5b..5d4c577e5a 100644 --- a/testsuite/surf/surf_usage.c +++ b/testsuite/surf/surf_usage.c @@ -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); diff --git a/testsuite/surf/surf_usage2.c b/testsuite/surf/surf_usage2.c index be028d260e..64a68aea8d 100644 --- a/testsuite/surf/surf_usage2.c +++ b/testsuite/surf/surf_usage2.c @@ -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 = -- 2.20.1