X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6edd98218de9a7958d1f1a4396a2d460eac2593a..bdfe4f8674f98efbf2d67ad854ef83a1d5f855ed:/src/surf/trace_mgr.c diff --git a/src/surf/trace_mgr.c b/src/surf/trace_mgr.c index e2a61fe4d2..3ce034e4b7 100644 --- a/src/surf/trace_mgr.c +++ b/src/surf/trace_mgr.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2004, 2005, 2007, 2009, 2010. The SimGrid Team. +/* Copyright (c) 2004-2005, 2007, 2009-2013. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -296,6 +296,13 @@ tmgr_trace_t tmgr_trace_new_from_string(const char *id, const char *input, id, linecount, last_event->delta, event.delta, input); } last_event->delta = event.delta - last_event->delta; + } else { + if(event.delta > 0.0){ + s_tmgr_event_t first_event; + first_event.delta=event.delta; + first_event.value=-1.0; + xbt_dynar_push(trace->s_list.event_list, &first_event); + } } xbt_dynar_push(trace->s_list.event_list, &event); last_event = @@ -437,7 +444,7 @@ tmgr_trace_event_t tmgr_history_get_next_event_leq(tmgr_history_t h, trace_event->idx++; } else if (event->delta > 0) { /* Last element, checking for periodicity */ xbt_heap_push(h->heap, trace_event, event_date + event->delta); - trace_event->idx = 0; + trace_event->idx = 1; /* not 0 as the first event is a placeholder to handle when events really start */ } else { /* We don't need this trace_event anymore */ trace_event->free_me = 1; }