X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9f193ebb754cd9095bce1c93fc3419b5586ce4aa..b362f44b3941a4b07a255240da19066915fbacb3:/src/surf/cpu.c diff --git a/src/surf/cpu.c b/src/surf/cpu.c index c24f936514..57ceb535b5 100644 --- a/src/surf/cpu.c +++ b/src/surf/cpu.c @@ -7,7 +7,7 @@ #include "cpu_private.h" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cpu, surf, +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf, "Logging specific to the SURF CPU module"); surf_cpu_resource_t surf_cpu_resource = NULL; @@ -128,7 +128,6 @@ static void action_cancel(surf_action_t action) static void action_recycle(surf_action_t action) { DIE_IMPOSSIBLE; - return; } static void action_change_state(surf_action_t action, @@ -312,6 +311,12 @@ static double get_speed(void *cpu, double load) return load*(((cpu_Cas01_t) cpu)->power_scale); } +static double get_available_speed(void *cpu) +{ + /* number between 0 and 1 */ + return ((cpu_Cas01_t) cpu)->power_current; +} + static void finalize(void) { xbt_dict_free(&cpu_set); @@ -382,6 +387,7 @@ static void surf_cpu_resource_init_internal(void) surf_cpu_resource->extension_public->get_state = get_state; surf_cpu_resource->extension_public->get_speed = get_speed; + surf_cpu_resource->extension_public->get_available_speed = get_available_speed; cpu_set = xbt_dict_new();