X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/48404c66fc4d8248308db1d1398cb79a6763077e..693515c53d38d9dd1ee48ce080e9259356ba6583:/src/surf/workstation_ptask_L07.c diff --git a/src/surf/workstation_ptask_L07.c b/src/surf/workstation_ptask_L07.c index 183c3053f1..f77530b1ac 100644 --- a/src/surf/workstation_ptask_L07.c +++ b/src/surf/workstation_ptask_L07.c @@ -134,6 +134,9 @@ static int ptask_action_unref(surf_action_t action) free(((surf_action_workstation_L07_t) action)->workstation_list); free(((surf_action_workstation_L07_t) action)->communication_amount); free(((surf_action_workstation_L07_t) action)->computation_amount); +#ifdef HAVE_TRACING + xbt_free(action->category); +#endif surf_action_free(&action); return 1; } @@ -344,8 +347,8 @@ static void ptask_update_resource_state(void *id, link_L07_t nw_link = id; if (nw_link->type == SURF_WORKSTATION_RESOURCE_LINK) { - XBT_DEBUG("Updating link %s (%p) with value=%f", - surf_resource_name(nw_link), nw_link, value); + XBT_DEBUG("Updating link %s (%p) with value=%f for date=%g", + surf_resource_name(nw_link), nw_link, value, date); if (event_type == nw_link->bw_event) { nw_link->bw_current = value; lmm_update_constraint_bound(ptask_maxmin_system, nw_link->constraint, @@ -443,6 +446,34 @@ static double ptask_get_available_speed(void *cpu) return ((cpu_L07_t)surf_workstation_resource_priv(cpu))->power_current; } +static double ws_get_current_power_peak(void *cpu) +{ + return ((cpu_L07_t)surf_workstation_resource_priv(cpu))->power_current; +} + +static double ws_get_power_peak_at(void *cpu, int pstate_index) +{ + XBT_DEBUG("[ws_get_power_peak_at] Not implemented for workstation_ptask_L07"); + return 0.0; +} + +static int ws_get_nb_pstates(void *workstation) +{ + XBT_DEBUG("[ws_get_nb_pstates] Not implemented for workstation_ptask_L07"); + return 0.0; +} + +static void ws_set_power_peak_at(void *cpu, int pstate_index) +{ + XBT_DEBUG("[ws_set_power_peak_at] Not implemented for workstation_ptask_L07"); +} + +static double ws_get_consumed_energy(void *cpu) +{ + XBT_DEBUG("[ws_get_consumed_energy] Not implemented for workstation_ptask_L07"); + return 0.0; +} + static surf_action_t ptask_execute_parallel_task(int workstation_nb, void **workstation_list, double @@ -637,7 +668,7 @@ static void* ptask_cpu_create_resource(const char *name, double power_scale, name); cpu = (cpu_L07_t) surf_resource_new(sizeof(s_cpu_L07_t), - surf_workstation_model, name,cpu_properties); + surf_workstation_model, name,cpu_properties, NULL); cpu->type = SURF_WORKSTATION_RESOURCE_CPU; cpu->info = xbt_lib_get_or_null(host_lib, name, ROUTING_HOST_LEVEL); @@ -667,9 +698,12 @@ static void* ptask_cpu_create_resource(const char *name, double power_scale, static void ptask_parse_cpu_init(sg_platf_host_cbarg_t host) { + double power_peak = xbt_dynar_get_as(host->power_peak, host->pstate, double); + //cpu->power_peak = power_peak; + xbt_dynar_free(&(host->power_peak)); /* kill memory leak */ ptask_cpu_create_resource( host->id, - host->power_peak, + power_peak, host->power_scale, host->power_trace, host->initial_state, @@ -876,6 +910,12 @@ static void ptask_model_init_internal(void) ptask_get_speed; surf_workstation_model->extension.workstation.get_available_speed = ptask_get_available_speed; + surf_workstation_model->extension.workstation.get_current_power_peak = ws_get_current_power_peak; + surf_workstation_model->extension.workstation.get_power_peak_at = ws_get_power_peak_at; + surf_workstation_model->extension.workstation.get_nb_pstates = ws_get_nb_pstates; + surf_workstation_model->extension.workstation.set_power_peak_at = ws_set_power_peak_at; + surf_workstation_model->extension.workstation.get_consumed_energy = ws_get_consumed_energy; + surf_workstation_model->extension.workstation.communicate = ptask_communicate; surf_workstation_model->extension.workstation.get_route =