X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7d4a9a7e27436e76b10c1b1f9ce794655dc070a2..a2dfa0431968bb948e2472de7aaeb26a28ad448a:/src/surf/surf.c diff --git a/src/surf/surf.c b/src/surf/surf.c index 22aeea5247..335351e2fe 100644 --- a/src/surf/surf.c +++ b/src/surf/surf.c @@ -418,6 +418,11 @@ void surf_init(int *argc, char **argv) if (!history) history = tmgr_history_new(); +#ifdef HAVE_TRACING + TRACE_add_start_function(TRACE_surf_alloc); + TRACE_add_end_function(TRACE_surf_release); +#endif + sg_config_init(argc, argv); surf_action_init(); @@ -518,9 +523,11 @@ void surf_presolve(void) tmgr_history_get_next_event_leq(history, next_event_date, &value, (void **) &resource))) { - resource->model->model_private->update_resource_state(resource, - event, value, - NOW); + if (value >= 0){ + resource->model->model_private->update_resource_state(resource, + event, value, + NOW); + } } } xbt_dynar_foreach(model_list, iter, model) @@ -598,12 +605,12 @@ double surf_solve(double max_date) min = model_next_action_end; } - if (next_event_date == -1.0) { + if (next_event_date < 0.0) { XBT_DEBUG("no next TRACE event. Stop searching for it"); break; } - if ((min != -1.0) && (next_event_date > NOW + min)) break; + if ((min == -1.0) || (next_event_date > NOW + min)) break; XBT_DEBUG("Updating models"); while ((event =