Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add new callback to the network model
[simgrid.git] / src / surf / cpu_ti.c
index 7ce67d0..b266cc4 100644 (file)
@@ -1,7 +1,6 @@
 
-/*     $Id$     */
-
-/* Copyright (c) 2004 Arnaud Legrand. All rights reserved.                  */
+/* Copyright (c) 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. */
@@ -726,6 +725,17 @@ static double cpu_ti_get_available_speed(void *cpu)
   return CPU->power_scale;
 }
 
+static void cpu_ti_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_ti_new(name,power_peak,power_scale,power_trace,
+                                         state_initial,state_trace,cpu_properties);
+}
+
 static void cpu_ti_finalize(void)
 {
   void *cpu;
@@ -784,6 +794,8 @@ static void surf_cpu_ti_model_init_internal(void)
   surf_cpu_model->extension.cpu.get_state = cpu_ti_get_state;
   surf_cpu_model->extension.cpu.get_speed = cpu_ti_get_speed;
   surf_cpu_model->extension.cpu.get_available_speed = cpu_ti_get_available_speed;
+  surf_cpu_model->extension.cpu.create_resource = cpu_ti_create_resource;
+  surf_cpu_model->extension.cpu.add_traces = add_traces_cpu_ti;
 
   cpu_ti_action_heap = xbt_heap_new(8, NULL);
   xbt_heap_set_update_callback(cpu_ti_action_heap, cpu_ti_action_update_index_heap);