X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b7726f2e9e252f8442b008a34bca31716c3b6c6b..54d4db7b7c8fa95028c7c279b87abaed1ba6c646:/src/surf/surf.c diff --git a/src/surf/surf.c b/src/surf/surf.c index a53a97f8bc..de54e4373c 100644 --- a/src/surf/surf.c +++ b/src/surf/surf.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011. The SimGrid Team. +/* Copyright (c) 2004-2013. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -352,14 +352,14 @@ double generic_share_resources_lazy(double now, surf_model_t model) max_dur_flag = 1; } - XBT_DEBUG("Action(%p) Start %lf Finish %lf Max_duration %lf", action, + XBT_DEBUG("Action(%p) Start %f Finish %f Max_duration %f", action, action->generic_action.start, now + value, action->generic_action.max_duration); if (min != -1) { surf_action_lmm_heap_remove(model->model_private->action_heap,action); surf_action_lmm_heap_insert(model->model_private->action_heap,action, min, max_dur_flag ? MAX_DURATION : NORMAL); - XBT_DEBUG("Insert at heap action(%p) min %lf now %lf", action, min, + XBT_DEBUG("Insert at heap action(%p) min %f now %f", action, min, now); } else DIE_IMPOSSIBLE; } @@ -370,7 +370,7 @@ double generic_share_resources_lazy(double now, surf_model_t model) else min = -1; - XBT_DEBUG("The minimum with the HEAP %lf", min); + XBT_DEBUG("The minimum with the HEAP %f", min); return min; } @@ -401,7 +401,7 @@ void surf_init(int *argc, char **argv) as_router_lib = xbt_lib_new(); storage_lib = xbt_lib_new(); storage_type_lib = xbt_lib_new(); - watched_hosts_lib = xbt_dict_new(); + watched_hosts_lib = xbt_dict_new_homogeneous(NULL); XBT_DEBUG("Add routing levels"); ROUTING_HOST_LEVEL = xbt_lib_add_level(host_lib,routing_asr_host_free); @@ -466,6 +466,11 @@ void surf_exit(void) unsigned int iter; surf_model_t model = NULL; +#ifdef HAVE_TRACING + TRACE_end(); /* Just in case it was not called by the upper + * layer (or there is no upper layer) */ +#endif + sg_config_finalize(); xbt_dynar_foreach(model_list, iter, model) @@ -488,7 +493,7 @@ void surf_exit(void) xbt_free(surf_mins); surf_mins = NULL; #endif - + xbt_dynar_free(&host_that_restart); xbt_dynar_free(&surf_path); xbt_lib_free(&host_lib); @@ -620,7 +625,7 @@ double surf_solve(double max_date) } /* update state of model_obj according to new value. Does not touch lmm. It will be modified if needed when updating actions */ - XBT_DEBUG("Calling update_resource_state for resource %s with min %lf", + XBT_DEBUG("Calling update_resource_state for resource %s with min %f", resource->name, min); resource->model->model_private->update_resource_state(resource,