1 /* Copyright (c) 2009-2011. The SimGrid Team.
2 * All rights reserved. */
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. */
7 #include "surf_private.h"
8 #include "surf/surf_resource.h"
9 #include "maxmin_private.h"
11 surf_model_t surf_cpu_model = NULL;
12 lmm_system_t cpu_maxmin_system = NULL;
13 e_UM_t cpu_update_mechanism = UM_UNDEFINED;
14 static int cpu_selective_update = 0;
16 static xbt_swag_t cpu_modified_set= NULL;
17 static xbt_heap_t cpu_action_heap = NULL;
19 #undef GENERIC_LMM_ACTION
22 #define GENERIC_LMM_ACTION(action) action->generic_lmm_action
23 #define GENERIC_ACTION(action) GENERIC_LMM_ACTION(action).generic_action
24 #define ACTION_GET_CPU(action) ((surf_action_cpu_Cas01_t) action)->cpu
26 typedef struct surf_action_cpu_cas01 {
27 s_surf_action_lmm_t generic_lmm_action;
28 } s_surf_action_cpu_Cas01_t, *surf_action_cpu_Cas01_t;
30 typedef struct cpu_Cas01 {
31 s_surf_resource_t generic_resource;
32 s_xbt_swag_hookup_t modified_cpu_hookup;
35 tmgr_trace_event_t power_event;
37 e_surf_resource_state_t state_current;
38 tmgr_trace_event_t state_event;
39 lmm_constraint_t constraint;
40 } s_cpu_Cas01_t, *cpu_Cas01_t;
42 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf,
43 "Logging specific to the SURF CPU IMPROVED module");
48 cpu_running_action_set_that_does_not_need_being_checked = NULL;
51 static void *cpu_create_resource(const char *name, double power_peak,
53 tmgr_trace_t power_trace,
55 e_surf_resource_state_t state_initial,
56 tmgr_trace_t state_trace,
57 xbt_dict_t cpu_properties)
59 cpu_Cas01_t cpu = NULL;
61 xbt_assert(!surf_cpu_resource_by_name(name),
62 "Host '%s' declared several times in the platform file",
64 cpu = (cpu_Cas01_t) surf_resource_new(sizeof(s_cpu_Cas01_t),
67 cpu->power_peak = power_peak;
68 xbt_assert(cpu->power_peak > 0, "Power has to be >0");
69 cpu->power_scale = power_scale;
71 xbt_assert(core > 0, "Invalid number of cores %d", core);
75 tmgr_history_add_trace(history, power_trace, 0.0, 0, cpu);
77 cpu->state_current = state_initial;
80 tmgr_history_add_trace(history, state_trace, 0.0, 0, cpu);
83 lmm_constraint_new(cpu_maxmin_system, cpu,
84 cpu->core * cpu->power_scale * cpu->power_peak);
86 xbt_lib_set(host_lib, name, SURF_CPU_LEVEL, cpu);
92 static void parse_cpu_init(sg_platf_host_cbarg_t host)
94 cpu_create_resource(host->id,
100 host->state_trace, host->properties);
103 static void cpu_add_traces_cpu(void)
105 xbt_dict_cursor_t cursor = NULL;
106 char *trace_name, *elm;
107 static int called = 0;
112 /* connect all traces relative to hosts */
113 xbt_dict_foreach(trace_connect_list_host_avail, cursor, trace_name, elm) {
114 tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
115 cpu_Cas01_t host = surf_cpu_resource_by_name(elm);
117 xbt_assert(host, "Host %s undefined", elm);
118 xbt_assert(trace, "Trace %s undefined", trace_name);
121 tmgr_history_add_trace(history, trace, 0.0, 0, host);
124 xbt_dict_foreach(trace_connect_list_power, cursor, trace_name, elm) {
125 tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
126 cpu_Cas01_t host = surf_cpu_resource_by_name(elm);
128 xbt_assert(host, "Host %s undefined", elm);
129 xbt_assert(trace, "Trace %s undefined", trace_name);
132 tmgr_history_add_trace(history, trace, 0.0, 0, host);
136 static void cpu_define_callbacks()
138 sg_platf_host_add_cb(parse_cpu_init);
139 sg_platf_postparse_add_cb(cpu_add_traces_cpu);
142 static int cpu_resource_used(void *resource)
144 return lmm_constraint_used(cpu_maxmin_system,
145 ((cpu_Cas01_t) resource)->constraint);
148 static int cpu_action_unref(surf_action_t action)
151 if (!action->refcount) {
152 xbt_swag_remove(action, action->state_set);
153 if (((surf_action_lmm_t) action)->variable)
154 lmm_variable_free(cpu_maxmin_system,
155 ((surf_action_lmm_t) action)->variable);
156 if (cpu_update_mechanism == UM_LAZY) {
157 /* remove from heap */
158 surf_action_lmm_heap_remove(cpu_action_heap,(surf_action_lmm_t)action);
159 xbt_swag_remove(action, cpu_modified_set);
162 xbt_free(action->category);
164 surf_action_free(&action);
170 static void cpu_action_cancel(surf_action_t action)
172 surf_action_state_set(action, SURF_ACTION_FAILED);
173 if (cpu_update_mechanism == UM_LAZY) {
174 xbt_swag_remove(action, cpu_modified_set);
175 surf_action_lmm_heap_remove(cpu_action_heap,(surf_action_lmm_t)action);
180 static void cpu_action_state_set(surf_action_t action,
181 e_surf_action_state_t state)
183 /* if((state==SURF_ACTION_DONE) || (state==SURF_ACTION_FAILED)) */
184 /* if(((surf_action_lmm_t)action)->variable) { */
185 /* lmm_variable_disable(cpu_maxmin_system, ((surf_action_lmm_t)action)->variable); */
186 /* ((surf_action_lmm_t)action)->variable = NULL; */
189 surf_action_state_set(action, state);
193 static void cpu_update_action_remaining_lazy(double now)
195 surf_action_cpu_Cas01_t action;
198 xbt_swag_foreach(action, cpu_modified_set) {
199 if (GENERIC_ACTION(action).state_set !=
200 surf_cpu_model->states.running_action_set)
201 continue; // FIXME useless ????
203 /* bogus priority, skip it */
204 if (GENERIC_ACTION(action).priority <= 0)
207 delta = now - GENERIC_LMM_ACTION(action).last_update;
208 if (GENERIC_ACTION(action).remains > 0) {
210 double_update(&(GENERIC_ACTION(action).remains),
211 lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable) * delta);
214 if (TRACE_is_enabled()) {
216 lmm_constraint_id(lmm_get_cnst_from_var
218 GENERIC_LMM_ACTION(action).variable, 0));
219 TRACE_surf_host_set_utilization(cpu->generic_resource.name,
220 ((surf_action_t)action)->category,
221 lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable),
222 GENERIC_LMM_ACTION(action).last_update,
223 now - GENERIC_LMM_ACTION(action).last_update);
226 XBT_DEBUG("Update action(%p) remains %lf", action,
227 GENERIC_ACTION(action).remains);
229 GENERIC_LMM_ACTION(action).last_update = now;
234 static double cpu_share_resources_lazy(double now)
236 surf_action_cpu_Cas01_t action = NULL;
241 ("Before share resources, the size of modified actions set is %d",
242 xbt_swag_size(cpu_modified_set));
243 cpu_update_action_remaining_lazy(now);
245 lmm_solve(cpu_maxmin_system);
248 ("After share resources, The size of modified actions set is %d",
249 xbt_swag_size(cpu_modified_set));
251 xbt_swag_foreach(action, cpu_modified_set) {
252 int max_dur_flag = 0;
254 if (GENERIC_ACTION(action).state_set !=
255 surf_cpu_model->states.running_action_set)
258 /* bogus priority, skip it */
259 if (GENERIC_ACTION(action).priority <= 0)
263 value = lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable);
265 if (GENERIC_ACTION(action).remains > 0) {
266 value = GENERIC_ACTION(action).remains / value;
274 if ((GENERIC_ACTION(action).max_duration != NO_MAX_DURATION)
276 || GENERIC_ACTION(action).start +
277 GENERIC_ACTION(action).max_duration < min)) {
278 min = GENERIC_ACTION(action).start +
279 GENERIC_ACTION(action).max_duration;
283 XBT_DEBUG("Action(%p) Start %lf Finish %lf Max_duration %lf", action,
284 GENERIC_ACTION(action).start, now + value,
285 GENERIC_ACTION(action).max_duration);
288 surf_action_lmm_heap_remove(cpu_action_heap,(surf_action_lmm_t)action);
289 surf_action_lmm_heap_insert(cpu_action_heap,(surf_action_lmm_t)action, min, max_dur_flag ? MAX_DURATION : NORMAL);
290 XBT_DEBUG("Insert at heap action(%p) min %lf now %lf", action, min,
292 } else DIE_IMPOSSIBLE;
295 //hereafter must have already the min value for this resource model
296 if (xbt_heap_size(cpu_action_heap) > 0)
297 min = xbt_heap_maxkey(cpu_action_heap) - now;
301 XBT_DEBUG("The minimum with the HEAP %lf", min);
306 static double cpu_share_resources_full(double now)
308 s_surf_action_cpu_Cas01_t action;
309 return generic_maxmin_share_resources(surf_cpu_model->states.
311 xbt_swag_offset(action,
314 cpu_maxmin_system, lmm_solve);
317 static void cpu_update_actions_state_lazy(double now, double delta)
319 surf_action_cpu_Cas01_t action;
320 while ((xbt_heap_size(cpu_action_heap) > 0)
321 && (double_equals(xbt_heap_maxkey(cpu_action_heap), now))) {
322 action = xbt_heap_pop(cpu_action_heap);
323 XBT_DEBUG("Action %p: finish", action);
324 GENERIC_ACTION(action).finish = surf_get_clock();
326 if (TRACE_is_enabled()) {
328 lmm_constraint_id(lmm_get_cnst_from_var
330 GENERIC_LMM_ACTION(action).variable, 0));
331 TRACE_surf_host_set_utilization(cpu->generic_resource.name,
332 ((surf_action_t)action)->category,
333 lmm_variable_getvalue(GENERIC_LMM_ACTION(action).variable),
334 GENERIC_LMM_ACTION(action).last_update,
335 now - GENERIC_LMM_ACTION(action).last_update);
338 /* set the remains to 0 due to precision problems when updating the remaining amount */
339 GENERIC_ACTION(action).remains = 0;
340 cpu_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
341 surf_action_lmm_heap_remove(cpu_action_heap,(surf_action_lmm_t)action);
344 if (TRACE_is_enabled()) {
345 //defining the last timestamp that we can safely dump to trace file
346 //without losing the event ascending order (considering all CPU's)
348 xbt_swag_t running_actions = surf_cpu_model->states.running_action_set;
349 xbt_swag_foreach(action, running_actions) {
351 smaller = GENERIC_LMM_ACTION(action).last_update;
354 if (GENERIC_LMM_ACTION(action).last_update < smaller) {
355 smaller = GENERIC_LMM_ACTION(action).last_update;
359 TRACE_last_timestamp_to_dump = smaller;
366 static void cpu_update_actions_state_full(double now, double delta)
368 surf_action_cpu_Cas01_t action = NULL;
369 surf_action_cpu_Cas01_t next_action = NULL;
370 xbt_swag_t running_actions = surf_cpu_model->states.running_action_set;
371 xbt_swag_foreach_safe(action, next_action, running_actions) {
373 if (TRACE_is_enabled()) {
375 lmm_constraint_id(lmm_get_cnst_from_var
377 GENERIC_LMM_ACTION(action).variable, 0));
379 TRACE_surf_host_set_utilization(x->generic_resource.name,
380 ((surf_action_t)action)->category,
381 lmm_variable_getvalue(GENERIC_LMM_ACTION(action).
385 TRACE_last_timestamp_to_dump = now - delta;
388 double_update(&(GENERIC_ACTION(action).remains),
389 lmm_variable_getvalue(GENERIC_LMM_ACTION(action).
391 if (GENERIC_LMM_ACTION(action).generic_action.max_duration !=
393 double_update(&(GENERIC_ACTION(action).max_duration), delta);
394 if ((GENERIC_ACTION(action).remains <= 0) &&
395 (lmm_get_variable_weight(GENERIC_LMM_ACTION(action).variable) >
397 GENERIC_ACTION(action).finish = surf_get_clock();
398 cpu_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
399 } else if ((GENERIC_ACTION(action).max_duration != NO_MAX_DURATION) &&
400 (GENERIC_ACTION(action).max_duration <= 0)) {
401 GENERIC_ACTION(action).finish = surf_get_clock();
402 cpu_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
409 static void cpu_update_resource_state(void *id,
410 tmgr_trace_event_t event_type,
411 double value, double date)
413 cpu_Cas01_t cpu = id;
414 lmm_variable_t var = NULL;
415 lmm_element_t elem = NULL;
417 if (event_type == cpu->power_event) {
418 cpu->power_scale = value;
419 lmm_update_constraint_bound(cpu_maxmin_system, cpu->constraint,
420 cpu->core * cpu->power_scale *
423 TRACE_surf_host_set_power(date, cpu->generic_resource.name,
424 cpu->core * cpu->power_scale *
427 while ((var = lmm_get_var_from_cnst
428 (cpu_maxmin_system, cpu->constraint, &elem))) {
429 surf_action_cpu_Cas01_t action = lmm_variable_id(var);
430 lmm_update_variable_bound(cpu_maxmin_system,
431 GENERIC_LMM_ACTION(action).variable,
432 cpu->power_scale * cpu->power_peak);
434 if (tmgr_trace_event_free(event_type))
435 cpu->power_event = NULL;
436 } else if (event_type == cpu->state_event) {
438 cpu->state_current = SURF_RESOURCE_ON;
440 lmm_constraint_t cnst = cpu->constraint;
442 cpu->state_current = SURF_RESOURCE_OFF;
444 while ((var = lmm_get_var_from_cnst(cpu_maxmin_system, cnst, &elem))) {
445 surf_action_t action = lmm_variable_id(var);
447 if (surf_action_state_get(action) == SURF_ACTION_RUNNING ||
448 surf_action_state_get(action) == SURF_ACTION_READY ||
449 surf_action_state_get(action) ==
450 SURF_ACTION_NOT_IN_THE_SYSTEM) {
451 action->finish = date;
452 cpu_action_state_set(action, SURF_ACTION_FAILED);
456 if (tmgr_trace_event_free(event_type))
457 cpu->state_event = NULL;
459 XBT_CRITICAL("Unknown event ! \n");
466 static surf_action_t cpu_execute(void *cpu, double size)
468 surf_action_cpu_Cas01_t action = NULL;
469 cpu_Cas01_t CPU = cpu;
471 XBT_IN("(%s,%g)", surf_resource_name(CPU), size);
473 surf_action_new(sizeof(s_surf_action_cpu_Cas01_t), size,
475 CPU->state_current != SURF_RESOURCE_ON);
477 GENERIC_LMM_ACTION(action).suspended = 0; /* Should be useless because of the
478 calloc but it seems to help valgrind... */
480 GENERIC_LMM_ACTION(action).variable =
481 lmm_variable_new(cpu_maxmin_system, action,
482 GENERIC_ACTION(action).priority,
483 CPU->power_scale * CPU->power_peak, 1);
484 if (cpu_update_mechanism == UM_LAZY) {
485 GENERIC_LMM_ACTION(action).index_heap = -1;
486 GENERIC_LMM_ACTION(action).last_update = surf_get_clock();
488 lmm_expand(cpu_maxmin_system, CPU->constraint,
489 GENERIC_LMM_ACTION(action).variable, 1.0);
491 return (surf_action_t) action;
494 static surf_action_t cpu_action_sleep(void *cpu, double duration)
496 surf_action_cpu_Cas01_t action = NULL;
499 duration = MAX(duration, MAXMIN_PRECISION);
501 XBT_IN("(%s,%g)", surf_resource_name(cpu), duration);
502 action = (surf_action_cpu_Cas01_t) cpu_execute(cpu, 1.0);
503 GENERIC_ACTION(action).max_duration = duration;
504 GENERIC_LMM_ACTION(action).suspended = 2;
505 if (duration == NO_MAX_DURATION) {
506 /* Move to the *end* of the corresponding action set. This convention
507 is used to speed up update_resource_state */
508 xbt_swag_remove(action, ((surf_action_t) action)->state_set);
509 ((surf_action_t) action)->state_set =
510 cpu_running_action_set_that_does_not_need_being_checked;
511 xbt_swag_insert(action, ((surf_action_t) action)->state_set);
514 lmm_update_variable_weight(cpu_maxmin_system,
515 GENERIC_LMM_ACTION(action).variable, 0.0);
516 if (cpu_update_mechanism == UM_LAZY) { // remove action from the heap
517 surf_action_lmm_heap_remove(cpu_action_heap,(surf_action_lmm_t)action);
518 // this is necessary for a variable with weight 0 since such
519 // variables are ignored in lmm and we need to set its max_duration
520 // correctly at the next call to share_resources
521 xbt_swag_insert_at_head(action,cpu_modified_set);
525 return (surf_action_t) action;
528 static void cpu_action_suspend(surf_action_t action)
530 XBT_IN("(%p)", action);
531 if (((surf_action_lmm_t) action)->suspended != 2) {
532 lmm_update_variable_weight(cpu_maxmin_system,
533 ((surf_action_lmm_t) action)->variable,
535 ((surf_action_lmm_t) action)->suspended = 1;
536 if (cpu_update_mechanism == UM_LAZY)
537 surf_action_lmm_heap_remove(cpu_action_heap,(surf_action_lmm_t)action);
542 static void cpu_action_resume(surf_action_t action)
545 XBT_IN("(%p)", action);
546 if (((surf_action_lmm_t) action)->suspended != 2) {
547 lmm_update_variable_weight(cpu_maxmin_system,
548 ((surf_action_lmm_t) action)->variable,
550 ((surf_action_lmm_t) action)->suspended = 0;
551 if (cpu_update_mechanism == UM_LAZY)
552 surf_action_lmm_heap_remove(cpu_action_heap,(surf_action_lmm_t)action);
557 static int cpu_action_is_suspended(surf_action_t action)
559 return (((surf_action_lmm_t) action)->suspended == 1);
562 static void cpu_action_set_max_duration(surf_action_t action,
565 XBT_IN("(%p,%g)", action, duration);
567 action->max_duration = duration;
568 if (cpu_update_mechanism == UM_LAZY)
569 surf_action_lmm_heap_remove(cpu_action_heap,(surf_action_lmm_t)action);
573 static void cpu_action_set_priority(surf_action_t action, double priority)
575 XBT_IN("(%p,%g)", action, priority);
576 action->priority = priority;
577 lmm_update_variable_weight(cpu_maxmin_system,
578 ((surf_action_lmm_t) action)->variable,
581 if (cpu_update_mechanism == UM_LAZY)
582 surf_action_lmm_heap_remove(cpu_action_heap,(surf_action_lmm_t)action);
587 static void cpu_action_set_category(surf_action_t action,
588 const char *category)
590 XBT_IN("(%p,%s)", action, category);
591 action->category = xbt_strdup(category);
596 static double cpu_action_get_remains(surf_action_t action)
598 XBT_IN("(%p)", action);
599 /* update remains before return it */
600 if (cpu_update_mechanism == UM_LAZY)
601 cpu_update_action_remaining_lazy(surf_get_clock());
603 return action->remains;
606 static e_surf_resource_state_t cpu_get_state(void *cpu)
608 return ((cpu_Cas01_t) cpu)->state_current;
611 static double cpu_get_speed(void *cpu, double load)
613 return load * (((cpu_Cas01_t) cpu)->power_peak);
616 static double cpu_get_available_speed(void *cpu)
618 /* number between 0 and 1 */
619 return ((cpu_Cas01_t) cpu)->power_scale;
622 static void cpu_finalize(void)
624 lmm_system_free(cpu_maxmin_system);
625 cpu_maxmin_system = NULL;
627 surf_model_exit(surf_cpu_model);
628 surf_cpu_model = NULL;
630 xbt_swag_free(cpu_running_action_set_that_does_not_need_being_checked);
631 cpu_running_action_set_that_does_not_need_being_checked = NULL;
633 xbt_heap_free(cpu_action_heap);
634 xbt_swag_free(cpu_modified_set);
637 static void surf_cpu_model_init_internal()
639 s_surf_action_t action;
640 s_surf_action_cpu_Cas01_t comp;
642 surf_cpu_model = surf_model_init();
644 cpu_running_action_set_that_does_not_need_being_checked =
645 xbt_swag_new(xbt_swag_offset(action, state_hookup));
647 surf_cpu_model->name = "cpu";
649 surf_cpu_model->action_unref = cpu_action_unref;
650 surf_cpu_model->action_cancel = cpu_action_cancel;
651 surf_cpu_model->action_state_set = cpu_action_state_set;
653 surf_cpu_model->model_private->resource_used = cpu_resource_used;
655 if (cpu_update_mechanism == UM_LAZY) {
656 surf_cpu_model->model_private->share_resources =
657 cpu_share_resources_lazy;
658 surf_cpu_model->model_private->update_actions_state =
659 cpu_update_actions_state_lazy;
660 } else if (cpu_update_mechanism == UM_FULL) {
661 surf_cpu_model->model_private->share_resources =
662 cpu_share_resources_full;
663 surf_cpu_model->model_private->update_actions_state =
664 cpu_update_actions_state_full;
666 xbt_die("Invalid update mechanism!");
668 surf_cpu_model->model_private->update_resource_state =
669 cpu_update_resource_state;
670 surf_cpu_model->model_private->finalize = cpu_finalize;
672 surf_cpu_model->suspend = cpu_action_suspend;
673 surf_cpu_model->resume = cpu_action_resume;
674 surf_cpu_model->is_suspended = cpu_action_is_suspended;
675 surf_cpu_model->set_max_duration = cpu_action_set_max_duration;
676 surf_cpu_model->set_priority = cpu_action_set_priority;
678 surf_cpu_model->set_category = cpu_action_set_category;
680 surf_cpu_model->get_remains = cpu_action_get_remains;
682 surf_cpu_model->extension.cpu.execute = cpu_execute;
683 surf_cpu_model->extension.cpu.sleep = cpu_action_sleep;
685 surf_cpu_model->extension.cpu.get_state = cpu_get_state;
686 surf_cpu_model->extension.cpu.get_speed = cpu_get_speed;
687 surf_cpu_model->extension.cpu.get_available_speed =
688 cpu_get_available_speed;
689 surf_cpu_model->extension.cpu.create_resource = cpu_create_resource;
690 surf_cpu_model->extension.cpu.add_traces = cpu_add_traces_cpu;
692 if (!cpu_maxmin_system) {
693 cpu_maxmin_system = lmm_system_new(cpu_selective_update);
695 if (cpu_update_mechanism == UM_LAZY) {
696 cpu_action_heap = xbt_heap_new(8, NULL);
697 xbt_heap_set_update_callback(cpu_action_heap,
698 surf_action_lmm_update_index_heap);
700 xbt_swag_new(xbt_swag_offset(comp, generic_lmm_action.action_list_hookup));
701 cpu_maxmin_system->keep_track = cpu_modified_set;
705 /*********************************************************************/
706 /* Basic sharing model for CPU: that is where all this started... ;) */
707 /*********************************************************************/
708 /* @InProceedings{casanova01simgrid, */
709 /* author = "H. Casanova", */
710 /* booktitle = "Proceedings of the IEEE Symposium on Cluster Computing */
711 /* and the Grid (CCGrid'01)", */
712 /* publisher = "IEEE Computer Society", */
713 /* title = "Simgrid: {A} Toolkit for the Simulation of Application */
717 /* note = "Available at */
718 /* \url{http://grail.sdsc.edu/papers/simgrid_ccgrid01.ps.gz}." */
721 void surf_cpu_model_init_Cas01()
723 char *optim = xbt_cfg_get_string(_surf_cfg_set, "cpu/optim");
725 xbt_cfg_get_int(_surf_cfg_set, "cpu/maxmin_selective_update");
727 if (!strcmp(optim, "Full")) {
728 cpu_update_mechanism = UM_FULL;
729 cpu_selective_update = select;
730 } else if (!strcmp(optim, "Lazy")) {
731 cpu_update_mechanism = UM_LAZY;
732 cpu_selective_update = 1;
733 xbt_assert((select == 1)
735 (xbt_cfg_is_default_value
736 (_surf_cfg_set, "cpu/maxmin_selective_update")),
737 "Disabling selective update while using the lazy update mechanism is dumb!");
738 } else if (!strcmp(optim, "TI")) {
739 surf_cpu_model_init_ti();
742 xbt_die("Unsupported optimization (%s) for this model", optim);
747 surf_cpu_model_init_internal();
748 cpu_define_callbacks();
749 xbt_dynar_push(model_list, &surf_cpu_model);