Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix format specifiers for sg_storage_size_t.
[simgrid.git] / src / surf / cpu_cas01_private.h
1
2 /* Copyright (c) 2009-2010, 2013. The SimGrid Team.
3  * All rights reserved.                                                     */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef _SURF_CPU_CAS01_PRIVATE_H
9 #define _SURF_CPU_CAS01_PRIVATE_H
10
11 #undef GENERIC_LMM_ACTION
12 #undef GENERIC_ACTION
13 #undef ACTION_GET_CPU
14 #define GENERIC_LMM_ACTION(action) action->generic_lmm_action
15 #define GENERIC_ACTION(action) GENERIC_LMM_ACTION(action).generic_action
16 #define ACTION_GET_CPU(action) ((surf_action_cpu_Cas01_t) action)->cpu
17
18 typedef struct surf_action_cpu_cas01 {
19   s_surf_action_lmm_t generic_lmm_action;
20 } s_surf_action_cpu_Cas01_t, *surf_action_cpu_Cas01_t;
21
22
23 /*
24  * Energy-related properties for the cpu_cas01 model
25  */
26 typedef struct energy_cpu_cas01 {
27         xbt_dynar_t power_range_watts_list;             /*< List of (min_power,max_power) pairs corresponding to each cpu pstate */
28         double total_energy;                                    /*< Total energy consumed by the host */
29         double last_updated;                                    /*< Timestamp of the last energy update event*/
30 } s_energy_cpu_cas01_t, *energy_cpu_cas01_t;
31
32
33 typedef struct cpu_Cas01 {
34   s_surf_resource_t generic_resource;
35   s_xbt_swag_hookup_t modified_cpu_hookup;
36   double power_peak;
37   double power_scale;
38   tmgr_trace_event_t power_event;
39   int core;
40   e_surf_resource_state_t state_current;
41   tmgr_trace_event_t state_event;
42   lmm_constraint_t constraint;
43
44   xbt_dynar_t power_peak_list;                          /*< List of supported CPU capacities */
45   int pstate;                                                           /*< Current pstate (index in the power_peak_list)*/
46   energy_cpu_cas01_t energy;                            /*< Structure with energy-consumption data */
47
48 } s_cpu_Cas01_t, *cpu_Cas01_t;
49
50 xbt_dynar_t cpu_get_watts_range_list(cpu_Cas01_t cpu_model);
51 void cpu_update_energy(cpu_Cas01_t cpu_model, double cpu_load);
52
53 #endif                          /* _SURF_CPU_CAS01_PRIVATE_H */