#include "surf_private.h"
#include "surf/surf_resource.h"
#include "maxmin_private.h"
#include "surf_private.h"
#include "surf/surf_resource.h"
#include "maxmin_private.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf,
"Logging specific to the SURF CPU IMPROVED module");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf,
"Logging specific to the SURF CPU IMPROVED module");
static void *cpu_create_resource(const char *name, double power_peak,
double power_scale,
tmgr_trace_t power_trace,
static void *cpu_create_resource(const char *name, double power_peak,
double power_scale,
tmgr_trace_t power_trace,
"Host '%s' declared several times in the platform file",
name);
cpu = (cpu_Cas01_t) surf_resource_new(sizeof(s_cpu_Cas01_t),
"Host '%s' declared several times in the platform file",
name);
cpu = (cpu_Cas01_t) surf_resource_new(sizeof(s_cpu_Cas01_t),
xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, cpu);
xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, cpu);
if (event_type == cpu->power_event) {
cpu->power_scale = value;
lmm_update_constraint_bound(surf_cpu_model->model_private->maxmin_system, cpu->constraint,
if (event_type == cpu->power_event) {
cpu->power_scale = value;
lmm_update_constraint_bound(surf_cpu_model->model_private->maxmin_system, cpu->constraint,
static surf_action_t cpu_execute(void *cpu, double size)
{
surf_action_cpu_Cas01_t action = NULL;
static surf_action_t cpu_execute(void *cpu, double size)
{
surf_action_cpu_Cas01_t action = NULL;
XBT_IN("(%s,%g)", surf_resource_name(CPU), size);
action =
XBT_IN("(%s,%g)", surf_resource_name(CPU), size);
action =
- XBT_IN("(%s,%g)", surf_resource_name(cpu), duration);
+ XBT_IN("(%s,%g)", surf_resource_name(surf_cpu_resource_priv(cpu)), duration);
action = (surf_action_cpu_Cas01_t) cpu_execute(cpu, 1.0);
// FIXME: sleep variables should not consume 1.0 in lmm_expand
GENERIC_ACTION(action).max_duration = duration;
action = (surf_action_cpu_Cas01_t) cpu_execute(cpu, 1.0);
// FIXME: sleep variables should not consume 1.0 in lmm_expand
GENERIC_ACTION(action).max_duration = duration;
"Disabling selective update while using the lazy update mechanism is dumb!");
} else {
xbt_die("Unsupported optimization (%s) for this model", optim);
"Disabling selective update while using the lazy update mechanism is dumb!");
} else {
xbt_die("Unsupported optimization (%s) for this model", optim);
surf_cpu_model->extension.cpu.get_speed = cpu_get_speed;
surf_cpu_model->extension.cpu.get_available_speed =
cpu_get_available_speed;
surf_cpu_model->extension.cpu.get_speed = cpu_get_speed;
surf_cpu_model->extension.cpu.get_available_speed =
cpu_get_available_speed;
surf_cpu_model->extension.cpu.add_traces = cpu_add_traces_cpu;
if (!surf_cpu_model->model_private->maxmin_system) {
surf_cpu_model->extension.cpu.add_traces = cpu_add_traces_cpu;
if (!surf_cpu_model->model_private->maxmin_system) {