X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/69b85c9e1af02bcf07222b50ffbe83781b6027b2..9fab0eca31af8ed80d8af4c4eddc983e685d0168:/src/surf/cpu.c diff --git a/src/surf/cpu.c b/src/surf/cpu.c index fb6e449e5e..b55c297ae5 100644 --- a/src/surf/cpu.c +++ b/src/surf/cpu.c @@ -1,6 +1,5 @@ -/* $Id$ */ - -/* Copyright (c) 2004 Arnaud Legrand. All rights reserved. */ +/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team. + * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -379,6 +378,17 @@ static double cpu_get_available_speed(void *cpu) return ((cpu_Cas01_t) cpu)->power_scale; } +static void cpu_create_resource(char *name, double power_peak, + double power_scale, + tmgr_trace_t power_trace, + e_surf_resource_state_t state_initial, + tmgr_trace_t state_trace, + xbt_dict_t cpu_properties) +{ + cpu_new(name,power_peak,power_scale,power_trace, + state_initial,state_trace,cpu_properties); +} + static void cpu_finalize(void) { lmm_system_free(cpu_maxmin_system); @@ -426,6 +436,8 @@ static void surf_cpu_model_init_internal(void) surf_cpu_model->extension.cpu.get_state = cpu_get_state; 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.create_resource = cpu_create_resource; + surf_cpu_model->extension.cpu.add_traces = add_traces_cpu; if (!cpu_maxmin_system) cpu_maxmin_system = lmm_system_new();