- net_create_resource;
-
- if (!network_maxmin_system)
- network_maxmin_system = lmm_system_new(net_selective_update);
-
- routing_model_create(sizeof(link_CM02_t),
- net_create_resource("__loopback__",
- 498000000, NULL, 0.000015, NULL,
- SURF_RESOURCE_ON, NULL,
- SURF_LINK_FATPIPE, NULL));
-
- if(network_update_mechanism == UM_LAZY){
- net_action_heap = xbt_heap_new(8,NULL);
- xbt_heap_set_update_callback(net_action_heap, net_action_update_index_heap);
- net_modified_set =
- xbt_swag_new(xbt_swag_offset(comm, action_list_hookup));
- }
-}
-
-static void set_update_mechanism(void) {
-#ifdef HAVE_TRACING
- TRACE_set_network_update_mechanism ();
-#endif
-
- char *optim = xbt_cfg_get_string(_surf_cfg_set, "network/optim");
- int select = xbt_cfg_get_int(_surf_cfg_set, "network/maxmin_selective_update");
-
- if(!strcmp(optim,"Full")) {
- network_update_mechanism = UM_FULL;
- net_selective_update = select;
- } else if (!strcmp(optim,"Lazy")) {
- network_update_mechanism = UM_LAZY;
- net_selective_update = 1;
- xbt_assert((select==1) || (xbt_cfg_is_default_value(_surf_cfg_set,"network/maxmin_selective_update")),
- "Disabling selective update while using the lazy update mechanism is dumb!");
- } else {
- xbt_die("Unsupported optimization (%s) for this model",optim);
+ net_create_resource;
+
+ if (!surf_network_model->model_private->maxmin_system)
+ surf_network_model->model_private->maxmin_system = lmm_system_new(surf_network_model->model_private->selective_update);
+
+ routing_model_create(net_create_resource("__loopback__",
+ 498000000, NULL, 0.000015, NULL,
+ SURF_RESOURCE_ON, NULL,
+ SURF_LINK_FATPIPE, NULL));
+
+ if (surf_network_model->model_private->update_mechanism == UM_LAZY) {
+ surf_network_model->model_private->action_heap = xbt_heap_new(8, NULL);
+ xbt_heap_set_update_callback(surf_network_model->model_private->action_heap,
+ surf_action_lmm_update_index_heap);
+ surf_network_model->model_private->modified_set =
+ xbt_swag_new(xbt_swag_offset(comm, generic_lmm_action.action_list_hookup));
+ surf_network_model->model_private->maxmin_system->keep_track = surf_network_model->model_private->modified_set;