X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/661875a3cf8631bf02abe783b948fb8c0230b67f..9b73466ada27682d1729f394549479da83ef4a99:/src/surf/cpu_cas01_private.h diff --git a/src/surf/cpu_cas01_private.h b/src/surf/cpu_cas01_private.h index b126a3b907..c212ca5ab4 100644 --- a/src/surf/cpu_cas01_private.h +++ b/src/surf/cpu_cas01_private.h @@ -1,4 +1,3 @@ - /* Copyright (c) 2013. The SimGrid Team. * All rights reserved. */ @@ -8,6 +7,27 @@ #ifndef _SURF_CPU_CAS01_PRIVATE_H #define _SURF_CPU_CAS01_PRIVATE_H +#undef GENERIC_LMM_ACTION +#undef GENERIC_ACTION +#undef ACTION_GET_CPU +#define GENERIC_LMM_ACTION(action) action->generic_lmm_action +#define GENERIC_ACTION(action) GENERIC_LMM_ACTION(action).generic_action +#define ACTION_GET_CPU(action) ((surf_action_cpu_Cas01_t) action)->cpu + +typedef struct surf_action_cpu_cas01 { + s_surf_action_lmm_t generic_lmm_action; +} s_surf_action_cpu_Cas01_t, *surf_action_cpu_Cas01_t; + +/* + * Energy-related properties for the cpu_cas01 model + */ +typedef struct energy_cpu_cas01 { + xbt_dynar_t power_range_watts_list; /*< List of (min_power,max_power) pairs corresponding to each cpu pstate */ + double total_energy; /*< Total energy consumed by the host */ + double last_updated; /*< Timestamp of the last energy update event*/ +} s_energy_cpu_cas01_t, *energy_cpu_cas01_t; + + typedef struct cpu_Cas01 { s_surf_resource_t generic_resource; s_xbt_swag_hookup_t modified_cpu_hookup; @@ -19,13 +39,18 @@ typedef struct cpu_Cas01 { tmgr_trace_event_t state_event; lmm_constraint_t constraint; + xbt_dynar_t power_peak_list; /*< List of supported CPU capacities */ + int pstate; /*< Current pstate (index in the power_peak_list)*/ + energy_cpu_cas01_t energy; + /* Note (hypervisor): */ lmm_constraint_t *constraint_core; } s_cpu_Cas01_t, *cpu_Cas01_t; void *cpu_cas01_create_resource(const char *name, - double power_peak, + xbt_dynar_t power_peak, + int pstate, double power_scale, tmgr_trace_t power_trace, int core, @@ -34,4 +59,7 @@ void *cpu_cas01_create_resource(const char *name, xbt_dict_t cpu_properties, surf_model_t cpu_model); +xbt_dynar_t cpu_get_watts_range_list(cpu_Cas01_t cpu_model); +void cpu_update_energy(cpu_Cas01_t cpu_model, double cpu_load); + #endif /* _SURF_CPU_CAS01_PRIVATE_H */