Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
added dvfs support
[simgrid.git] / src / surf / cpu_cas01.c
1 /* Copyright (c) 2009-2011. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include "surf_private.h"
8 #include "surf/surf_resource.h"
9 #include "maxmin_private.h"
10 #include "simgrid/sg_config.h"
11 #include "cpu_cas01_private.h"
12
13 #include "string.h"
14 #include "stdlib.h"
15
16 surf_model_t surf_cpu_model = NULL;
17
18
19 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf,
20                                 "Logging specific to the SURF CPU IMPROVED module");
21
22 static xbt_swag_t
23     cpu_running_action_set_that_does_not_need_being_checked = NULL;
24
25
26 /* This function is registered as a callback to sg_platf_new_host() and never called directly */
27 static void *cpu_create_resource(const char *name, xbt_dynar_t power_peak,
28                                                                  int pstate,
29                                  double power_scale,
30                                  tmgr_trace_t power_trace,
31                                  int core,
32                                  e_surf_resource_state_t state_initial,
33                                  tmgr_trace_t state_trace,
34                                  xbt_dict_t cpu_properties)
35 {
36   cpu_Cas01_t cpu = NULL;
37
38   xbt_assert(!surf_cpu_resource_priv(surf_cpu_resource_by_name(name)),
39              "Host '%s' declared several times in the platform file",
40              name);
41   cpu = (cpu_Cas01_t) surf_resource_new(sizeof(s_cpu_Cas01_t),
42                                         surf_cpu_model, name,
43                                         cpu_properties);
44   cpu->power_peak = xbt_dynar_get_as(power_peak, pstate, double);
45   cpu->power_peak_list = power_peak;
46   cpu->pstate = pstate;
47
48   cpu->energy = xbt_new(s_energy_cpu_cas01_t, 1);
49   cpu->energy->total_energy = 0;
50   cpu->energy->power_range_watts_list = cpu_get_watts_range_list(cpu);
51   cpu->energy->last_updated = surf_get_clock();
52
53   XBT_DEBUG("CPU create: peak=%lf, pstate=%d",cpu->power_peak, cpu->pstate);
54
55   xbt_assert(cpu->power_peak > 0, "Power has to be >0");
56   cpu->power_scale = power_scale;
57   cpu->core = core;
58   xbt_assert(core > 0, "Invalid number of cores %d", core);
59
60   if (power_trace)
61     cpu->power_event =
62         tmgr_history_add_trace(history, power_trace, 0.0, 0, cpu);
63
64   cpu->state_current = state_initial;
65   if (state_trace)
66     cpu->state_event =
67         tmgr_history_add_trace(history, state_trace, 0.0, 0, cpu);
68
69   cpu->constraint =
70       lmm_constraint_new(surf_cpu_model->model_private->maxmin_system, cpu,
71                          cpu->core * cpu->power_scale * cpu->power_peak);
72
73   xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, cpu);
74
75   return xbt_lib_get_elm_or_null(host_lib, name);;
76 }
77
78
79 static void parse_cpu_init(sg_platf_host_cbarg_t host)
80 {
81   cpu_create_resource(host->id,
82                       host->power_peak,
83                       host->pstate,
84                       host->power_scale,
85                       host->power_trace,
86                       host->core_amount,
87                       host->initial_state,
88                       host->state_trace, host->properties);
89 }
90
91 static void cpu_add_traces_cpu(void)
92 {
93   xbt_dict_cursor_t cursor = NULL;
94   char *trace_name, *elm;
95   static int called = 0;
96   if (called)
97     return;
98   called = 1;
99
100   /* connect all traces relative to hosts */
101   xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
102     tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
103     cpu_Cas01_t host = surf_cpu_resource_by_name(elm);
104
105     xbt_assert(host, "Host %s undefined", elm);
106     xbt_assert(trace, "Trace %s undefined", trace_name);
107
108     host->state_event =
109         tmgr_history_add_trace(history, trace, 0.0, 0, host);
110   }
111
112   xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
113     tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
114     cpu_Cas01_t host = surf_cpu_resource_by_name(elm);
115
116     xbt_assert(host, "Host %s undefined", elm);
117     xbt_assert(trace, "Trace %s undefined", trace_name);
118
119     host->power_event =
120         tmgr_history_add_trace(history, trace, 0.0, 0, host);
121   }
122 }
123
124 static void cpu_define_callbacks()
125 {
126   sg_platf_host_add_cb(parse_cpu_init);
127   sg_platf_postparse_add_cb(cpu_add_traces_cpu);
128 }
129
130 static int cpu_resource_used(void *resource)
131 {
132   return lmm_constraint_used(surf_cpu_model->model_private->maxmin_system,
133                              ((cpu_Cas01_t) resource)->constraint);
134 }
135
136 static double cpu_share_resources_lazy(double now)
137 {
138   return generic_share_resources_lazy(now, surf_cpu_model);
139 }
140
141 static double cpu_share_resources_full(double now)
142 {
143   s_surf_action_cpu_Cas01_t action;
144   return generic_maxmin_share_resources(surf_cpu_model->states.
145                                         running_action_set,
146                                         xbt_swag_offset(action,
147                                                         generic_lmm_action.
148                                                         variable),
149                                         surf_cpu_model->model_private->maxmin_system, lmm_solve);
150 }
151
152 static void cpu_update_actions_state_lazy(double now, double delta)
153 {
154   generic_update_actions_state_lazy(now, delta, surf_cpu_model);
155 }
156
157 static void cpu_update_actions_state_full(double now, double delta)
158 {
159   generic_update_actions_state_full(now, delta, surf_cpu_model);
160 }
161
162 xbt_dynar_t cpu_get_watts_range_list(cpu_Cas01_t cpu_model)
163 {
164         xbt_dynar_t power_range_list = xbt_dynar_new(sizeof(xbt_dynar_t), NULL);
165         xbt_dynar_t power_tuple;
166         int i = 0, pstate_nb=0;
167         xbt_dynar_t current_power_values;
168         double min_power, max_power;
169         xbt_dict_t props = cpu_model->generic_resource.properties;
170
171         if (props == NULL)
172                 return NULL;
173
174         char* all_power_values_str = xbt_dict_get_or_null(props, "power_per_state");
175
176         if (all_power_values_str == NULL)
177                 return NULL;
178
179         xbt_dynar_t all_power_values = xbt_str_split(all_power_values_str, ",");
180
181         pstate_nb = xbt_dynar_length(all_power_values);
182         for (i=0; i< pstate_nb; i++)
183         {
184                 /* retrieve the power values associated with the current pstate */
185                 current_power_values = xbt_str_split(xbt_dynar_get_as(all_power_values, i, char*), ":");
186                 xbt_assert(xbt_dynar_length(current_power_values) > 1,
187                                 "Power properties incorrectly defined - could not retrieve min and max power values for host %s",
188                                 cpu_model->generic_resource.name);
189
190                 /* min_power corresponds to the idle power (cpu load = 0) */
191                 /* max_power is the power consumed at 100% cpu load       */
192                 min_power = atof(xbt_dynar_get_as(current_power_values, 0, char*));
193                 max_power = atof(xbt_dynar_get_as(current_power_values, 1, char*));
194
195                 power_tuple = xbt_dynar_new(sizeof(double), NULL);
196                 xbt_dynar_push_as(power_tuple, double, min_power);
197                 xbt_dynar_push_as(power_tuple, double, max_power);
198
199                 xbt_dynar_push_as(power_range_list, xbt_dynar_t, power_tuple);
200         }
201
202         return power_range_list;
203
204 }
205
206 static double cpu_get_current_watts_value(cpu_Cas01_t cpu_model, double cpu_load)
207 {
208         xbt_dynar_t power_range_list = cpu_model->energy->power_range_watts_list;
209
210         if (power_range_list == NULL)
211         {
212                 XBT_DEBUG("No power range properties specified for host %s", cpu_model->generic_resource.name);
213                 return 0;
214         }
215         xbt_assert(xbt_dynar_length(power_range_list) == xbt_dynar_length(cpu_model->power_peak_list),
216                                                 "The number of power ranges in the properties does not match the number of pstates for host %s",
217                                                 cpu_model->generic_resource.name);
218
219     /* retrieve the power values associated with the current pstate */
220     xbt_dynar_t current_power_values = xbt_dynar_get_as(power_range_list, cpu_model->pstate, xbt_dynar_t);
221
222     /* min_power corresponds to the idle power (cpu load = 0) */
223     /* max_power is the power consumed at 100% cpu load       */
224     double min_power = xbt_dynar_get_as(current_power_values, 0, double);
225     double max_power = xbt_dynar_get_as(current_power_values, 1, double);
226     double power_slope = max_power - min_power;
227
228     double current_power = min_power + cpu_load * power_slope;
229
230         XBT_DEBUG("[get_current_watts] min_power=%lf, max_power=%lf, slope=%lf", min_power, max_power, power_slope);
231     XBT_DEBUG("[get_current_watts] Current power (watts) = %lf, load = %lf", current_power, cpu_load);
232
233         return current_power;
234
235 }
236
237 /**
238  * Updates the total energy consumed as the sum of the current energy and
239  *                                               the energy consumed by the current action
240  */
241 void cpu_update_energy(cpu_Cas01_t cpu_model, double cpu_load)
242 {
243
244   double start_time = cpu_model->energy->last_updated;
245   double finish_time = surf_get_clock();
246
247   XBT_DEBUG("[cpu_update_energy] action time interval=(%lf-%lf), current power peak=%lf, current pstate=%d",
248                   start_time, finish_time, cpu_model->power_peak, cpu_model->pstate);
249   double current_energy = cpu_model->energy->total_energy;
250   double action_energy = cpu_get_current_watts_value(cpu_model, cpu_load)*(finish_time-start_time);
251
252   cpu_model->energy->total_energy = current_energy + action_energy;
253   cpu_model->energy->last_updated = finish_time;
254
255   XBT_DEBUG("[cpu_update_energy] old_energy_value=%lf, action_energy_value=%lf", current_energy, action_energy);
256
257 }
258
259 static void cpu_update_resource_state(void *id,
260                                       tmgr_trace_event_t event_type,
261                                       double value, double date)
262 {
263   cpu_Cas01_t cpu = id;
264   lmm_variable_t var = NULL;
265   lmm_element_t elem = NULL;
266
267   surf_watched_hosts();
268
269   if (event_type == cpu->power_event) {
270     cpu->power_scale = value;
271     lmm_update_constraint_bound(surf_cpu_model->model_private->maxmin_system, cpu->constraint,
272                                 cpu->core * cpu->power_scale *
273                                 cpu->power_peak);
274 #ifdef HAVE_TRACING
275     TRACE_surf_host_set_power(date, cpu->generic_resource.name,
276                               cpu->core * cpu->power_scale *
277                               cpu->power_peak);
278 #endif
279     while ((var = lmm_get_var_from_cnst
280             (surf_cpu_model->model_private->maxmin_system, cpu->constraint, &elem))) {
281       surf_action_cpu_Cas01_t action = lmm_variable_id(var);
282       lmm_update_variable_bound(surf_cpu_model->model_private->maxmin_system,
283                                 GENERIC_LMM_ACTION(action).variable,
284                                 cpu->power_scale * cpu->power_peak);
285     }
286     if (tmgr_trace_event_free(event_type))
287       cpu->power_event = NULL;
288   } else if (event_type == cpu->state_event) {
289     if (value > 0)
290       cpu->state_current = SURF_RESOURCE_ON;
291     else {
292       lmm_constraint_t cnst = cpu->constraint;
293
294       cpu->state_current = SURF_RESOURCE_OFF;
295
296       while ((var = lmm_get_var_from_cnst(surf_cpu_model->model_private->maxmin_system, cnst, &elem))) {
297         surf_action_t action = lmm_variable_id(var);
298
299         if (surf_action_state_get(action) == SURF_ACTION_RUNNING ||
300             surf_action_state_get(action) == SURF_ACTION_READY ||
301             surf_action_state_get(action) ==
302             SURF_ACTION_NOT_IN_THE_SYSTEM) {
303           action->finish = date;
304           surf_action_state_set(action, SURF_ACTION_FAILED);
305         }
306       }
307     }
308     if (tmgr_trace_event_free(event_type))
309       cpu->state_event = NULL;
310   } else {
311     XBT_CRITICAL("Unknown event ! \n");
312     xbt_abort();
313   }
314
315   return;
316 }
317
318 static surf_action_t cpu_execute(void *cpu, double size)
319 {
320   surf_action_cpu_Cas01_t action = NULL;
321   //xbt_dict_cursor_t cursor = NULL;
322   cpu_Cas01_t CPU = surf_cpu_resource_priv(cpu);
323   //xbt_dict_t props = CPU->generic_resource.properties;
324
325   XBT_IN("(%s,%g)", surf_resource_name(CPU), size);
326   action =
327       surf_action_new(sizeof(s_surf_action_cpu_Cas01_t), size,
328                       surf_cpu_model,
329                       CPU->state_current != SURF_RESOURCE_ON);
330
331   GENERIC_LMM_ACTION(action).suspended = 0;     /* Should be useless because of the
332                                                    calloc but it seems to help valgrind... */
333
334   GENERIC_LMM_ACTION(action).variable =
335       lmm_variable_new(surf_cpu_model->model_private->maxmin_system, action,
336                        GENERIC_ACTION(action).priority,
337                        CPU->power_scale * CPU->power_peak, 1);
338   if (surf_cpu_model->model_private->update_mechanism == UM_LAZY) {
339     GENERIC_LMM_ACTION(action).index_heap = -1;
340     GENERIC_LMM_ACTION(action).last_update = surf_get_clock();
341     GENERIC_LMM_ACTION(action).last_value = 0.0;
342   }
343
344   lmm_expand(surf_cpu_model->model_private->maxmin_system, CPU->constraint,
345              GENERIC_LMM_ACTION(action).variable, 1.0);
346   XBT_OUT();
347   return (surf_action_t) action;
348 }
349
350 static surf_action_t cpu_action_sleep(void *cpu, double duration)
351 {
352   surf_action_cpu_Cas01_t action = NULL;
353
354   if (duration > 0)
355     duration = MAX(duration, MAXMIN_PRECISION);
356
357   XBT_IN("(%s,%g)", surf_resource_name(surf_cpu_resource_priv(cpu)), duration);
358   action = (surf_action_cpu_Cas01_t) cpu_execute(cpu, 1.0);
359   // FIXME: sleep variables should not consume 1.0 in lmm_expand
360   GENERIC_ACTION(action).max_duration = duration;
361   GENERIC_LMM_ACTION(action).suspended = 2;
362   if (duration == NO_MAX_DURATION) {
363     /* Move to the *end* of the corresponding action set. This convention
364        is used to speed up update_resource_state  */
365     xbt_swag_remove(action, ((surf_action_t) action)->state_set);
366     ((surf_action_t) action)->state_set =
367         cpu_running_action_set_that_does_not_need_being_checked;
368     xbt_swag_insert(action, ((surf_action_t) action)->state_set);
369   }
370
371   lmm_update_variable_weight(surf_cpu_model->model_private->maxmin_system,
372                              GENERIC_LMM_ACTION(action).variable, 0.0);
373   if (surf_cpu_model->model_private->update_mechanism == UM_LAZY) {     // remove action from the heap
374     surf_action_lmm_heap_remove(surf_cpu_model->model_private->action_heap,(surf_action_lmm_t)action);
375     // this is necessary for a variable with weight 0 since such
376     // variables are ignored in lmm and we need to set its max_duration
377     // correctly at the next call to share_resources
378     xbt_swag_insert_at_head(action,surf_cpu_model->model_private->modified_set);
379   }
380
381   XBT_OUT();
382   return (surf_action_t) action;
383 }
384
385 static e_surf_resource_state_t cpu_get_state(void *cpu)
386 {
387   return ((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->state_current;
388 }
389
390 static double cpu_get_speed(void *cpu, double load)
391 {
392   return load * ((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->power_peak;
393 }
394
395 static double cpu_get_available_speed(void *cpu)
396 {
397   /* number between 0 and 1 */
398   return ((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->power_scale;
399 }
400
401 static double cpu_get_current_power_peak(void *cpu)
402 {
403   return ((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->power_peak;
404 }
405
406 static double cpu_get_power_peak_at(void *cpu, int pstate_index)
407 {
408   xbt_dynar_t plist = ((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->power_peak_list;
409   xbt_assert((pstate_index <= xbt_dynar_length(plist)), "Invalid parameters (pstate index out of bounds)");
410
411   return xbt_dynar_get_as(plist, pstate_index, double);
412 }
413
414 static int cpu_get_nb_pstates(void *cpu)
415 {
416   return xbt_dynar_length(((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->power_peak_list);
417 }
418
419 static void cpu_set_power_peak_at(void *cpu, int pstate_index)
420 {
421   cpu_Cas01_t cpu_implem = (cpu_Cas01_t)surf_cpu_resource_priv(cpu);
422   xbt_dynar_t plist = cpu_implem->power_peak_list;
423   xbt_assert((pstate_index <= xbt_dynar_length(plist)), "Invalid parameters (pstate index out of bounds)");
424
425   double new_power_peak = xbt_dynar_get_as(plist, pstate_index, double);
426   cpu_implem->pstate = pstate_index;
427   cpu_implem->power_peak = new_power_peak;
428 }
429
430 static double cpu_get_consumed_energy(void *cpu)
431 {
432   return ((cpu_Cas01_t)surf_cpu_resource_priv(cpu))->energy->total_energy;
433 }
434
435 static void cpu_finalize(void)
436 {
437   lmm_system_free(surf_cpu_model->model_private->maxmin_system);
438   surf_cpu_model->model_private->maxmin_system = NULL;
439
440   if (surf_cpu_model->model_private->action_heap)
441     xbt_heap_free(surf_cpu_model->model_private->action_heap);
442   xbt_swag_free(surf_cpu_model->model_private->modified_set);
443
444   surf_model_exit(surf_cpu_model);
445   surf_cpu_model = NULL;
446
447   xbt_swag_free(cpu_running_action_set_that_does_not_need_being_checked);
448   cpu_running_action_set_that_does_not_need_being_checked = NULL;
449 }
450
451 static void surf_cpu_model_init_internal()
452 {
453   s_surf_action_t action;
454   s_surf_action_cpu_Cas01_t comp;
455
456   char *optim = xbt_cfg_get_string(_sg_cfg_set, "cpu/optim");
457   int select =
458       xbt_cfg_get_boolean(_sg_cfg_set, "cpu/maxmin_selective_update");
459
460   surf_cpu_model = surf_model_init();
461
462   if (!strcmp(optim, "Full")) {
463     surf_cpu_model->model_private->update_mechanism = UM_FULL;
464     surf_cpu_model->model_private->selective_update = select;
465   } else if (!strcmp(optim, "Lazy")) {
466     surf_cpu_model->model_private->update_mechanism = UM_LAZY;
467     surf_cpu_model->model_private->selective_update = 1;
468     xbt_assert((select == 1)
469                ||
470                (xbt_cfg_is_default_value
471                 (_sg_cfg_set, "cpu/maxmin_selective_update")),
472                "Disabling selective update while using the lazy update mechanism is dumb!");
473   } else {
474     xbt_die("Unsupported optimization (%s) for this model", optim);
475   }
476
477   cpu_running_action_set_that_does_not_need_being_checked =
478       xbt_swag_new(xbt_swag_offset(action, state_hookup));
479
480   surf_cpu_model->name = "cpu";
481
482   surf_cpu_model->action_unref = surf_action_unref;
483   surf_cpu_model->action_cancel = surf_action_cancel;
484   surf_cpu_model->action_state_set = surf_action_state_set;
485
486   surf_cpu_model->model_private->resource_used = cpu_resource_used;
487
488   if (surf_cpu_model->model_private->update_mechanism == UM_LAZY) {
489     surf_cpu_model->model_private->share_resources =
490         cpu_share_resources_lazy;
491     surf_cpu_model->model_private->update_actions_state =
492         cpu_update_actions_state_lazy;
493   } else if (surf_cpu_model->model_private->update_mechanism == UM_FULL) {
494     surf_cpu_model->model_private->share_resources =
495         cpu_share_resources_full;
496     surf_cpu_model->model_private->update_actions_state =
497         cpu_update_actions_state_full;
498   } else
499     xbt_die("Invalid cpu update mechanism!");
500
501   surf_cpu_model->model_private->update_resource_state =
502       cpu_update_resource_state;
503   surf_cpu_model->model_private->finalize = cpu_finalize;
504
505   surf_cpu_model->suspend = surf_action_suspend;
506   surf_cpu_model->resume = surf_action_resume;
507   surf_cpu_model->is_suspended = surf_action_is_suspended;
508   surf_cpu_model->set_max_duration = surf_action_set_max_duration;
509   surf_cpu_model->set_priority = surf_action_set_priority;
510 #ifdef HAVE_TRACING
511   surf_cpu_model->set_category = surf_action_set_category;
512 #endif
513   surf_cpu_model->get_remains = surf_action_get_remains;
514
515   surf_cpu_model->extension.cpu.execute = cpu_execute;
516   surf_cpu_model->extension.cpu.sleep = cpu_action_sleep;
517
518   surf_cpu_model->extension.cpu.get_state = cpu_get_state;
519   surf_cpu_model->extension.cpu.get_speed = cpu_get_speed;
520   surf_cpu_model->extension.cpu.get_available_speed =
521       cpu_get_available_speed;
522   surf_cpu_model->extension.cpu.get_current_power_peak = cpu_get_current_power_peak;
523   surf_cpu_model->extension.cpu.get_power_peak_at = cpu_get_power_peak_at;
524   surf_cpu_model->extension.cpu.get_nb_pstates = cpu_get_nb_pstates;
525   surf_cpu_model->extension.cpu.set_power_peak_at = cpu_set_power_peak_at;
526   surf_cpu_model->extension.cpu.get_consumed_energy = cpu_get_consumed_energy;
527
528   surf_cpu_model->extension.cpu.add_traces = cpu_add_traces_cpu;
529
530   if (!surf_cpu_model->model_private->maxmin_system) {
531     surf_cpu_model->model_private->maxmin_system = lmm_system_new(surf_cpu_model->model_private->selective_update);
532   }
533   if (surf_cpu_model->model_private->update_mechanism == UM_LAZY) {
534     surf_cpu_model->model_private->action_heap = xbt_heap_new(8, NULL);
535     xbt_heap_set_update_callback(surf_cpu_model->model_private->action_heap,
536         surf_action_lmm_update_index_heap);
537     surf_cpu_model->model_private->modified_set =
538         xbt_swag_new(xbt_swag_offset(comp, generic_lmm_action.action_list_hookup));
539     surf_cpu_model->model_private->maxmin_system->keep_track = surf_cpu_model->model_private->modified_set;
540   }
541 }
542
543 /*********************************************************************/
544 /* Basic sharing model for CPU: that is where all this started... ;) */
545 /*********************************************************************/
546 /* @InProceedings{casanova01simgrid, */
547 /*   author =       "H. Casanova", */
548 /*   booktitle =    "Proceedings of the IEEE Symposium on Cluster Computing */
549 /*                  and the Grid (CCGrid'01)", */
550 /*   publisher =    "IEEE Computer Society", */
551 /*   title =        "Simgrid: {A} Toolkit for the Simulation of Application */
552 /*                  Scheduling", */
553 /*   year =         "2001", */
554 /*   month =        may, */
555 /*   note =         "Available at */
556 /*                  \url{http://grail.sdsc.edu/papers/simgrid_ccgrid01.ps.gz}." */
557 /* } */
558
559 void surf_cpu_model_init_Cas01()
560 {
561   char *optim = xbt_cfg_get_string(_sg_cfg_set, "cpu/optim");
562
563   if (surf_cpu_model)
564     return;
565
566   if (!strcmp(optim, "TI")) {
567     surf_cpu_model_init_ti();
568     return;
569   }
570
571   surf_cpu_model_init_internal();
572   cpu_define_callbacks();
573   xbt_dynar_push(model_list, &surf_cpu_model);
574 }