X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/00db56dc1eb37659b946d5b0f0d2fcd514c78a6f..d7fe15f62820f53f48d0f894212373fac36e449b:/src/surf/workstation.c diff --git a/src/surf/workstation.c b/src/surf/workstation.c index f2704ddbe0..733aac7b8e 100644 --- a/src/surf/workstation.c +++ b/src/surf/workstation.c @@ -10,7 +10,10 @@ #include "portable.h" #include "workstation_private.h" #include "cpu_private.h" -#include "network_private.h" +#include "network_common.h" + +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_workstation, surf, + "Logging specific to the SURF workstation module"); surf_workstation_model_t surf_workstation_model = NULL; xbt_dict_t workstation_set = NULL; @@ -34,7 +37,7 @@ static void workstation_free(void *workstation) free(workstation); } -static void create_workstations(void) +void create_workstations(void) { xbt_dict_cursor_t cursor = NULL; char *name = NULL; @@ -251,6 +254,12 @@ static double get_available_speed(void *workstation) get_available_speed(((workstation_CLM03_t) workstation)->cpu); } +static xbt_dict_t get_properties(void *workstation) +{ + return surf_cpu_model->common_public-> + get_properties(((workstation_CLM03_t) workstation)->cpu); +} + static surf_action_t execute_parallel_task(int workstation_nb, void **workstation_list, double *computation_amount, @@ -383,6 +392,10 @@ static void surf_workstation_model_init_internal(void) surf_workstation_model->extension_public->get_speed = get_speed; surf_workstation_model->extension_public->get_available_speed = get_available_speed; + + /*manage the properties of the workstation*/ + surf_workstation_model->common_public->get_properties = get_properties; + surf_workstation_model->extension_public->communicate = communicate; surf_workstation_model->extension_public->execute_parallel_task = execute_parallel_task; @@ -414,7 +427,6 @@ void surf_workstation_model_init_CLM03(const char *filename) surf_workstation_model_init_internal(); surf_cpu_model_init_Cas01(filename); surf_network_model_init_CM02(filename); - create_workstations(); update_model_description(surf_workstation_model_description, surf_workstation_model_description_size, "CLM03", @@ -428,7 +440,6 @@ void surf_workstation_model_init_compound(const char *filename) xbt_assert0(surf_cpu_model, "No CPU model defined yet!"); xbt_assert0(surf_network_model, "No network model defined yet!"); surf_workstation_model_init_internal(); - create_workstations(); update_model_description(surf_workstation_model_description, surf_workstation_model_description_size,