details:
- for CPU model Cas01_fullupdate, it is safe to set TRACE_last_timestamp_to_dump to now-delta
- for CPU model Cas01, the last timestamp to be dumped must be equal
to the smaller cpu->last_update among all cpu resources
- for now, network models depend on cpu models to dump their events
=> if a simulator is configured to have only a network model, without
an instrumented cpu model (or without a cpu model at all), the
dump will occur only in the end of simulation.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9331
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
lmm_variable_getvalue
(action->variable), now - delta,
delta);
+ TRACE_last_timestamp_to_dump = now-delta;
#endif
double_update(&(action->generic_action.remains),
lmm_variable_getvalue(action->variable) * delta);
cpu_im_cpu_action_state_set((surf_action_t) action, SURF_ACTION_DONE);
cpu_im_update_remains(action->cpu, surf_get_clock());
}
+#ifdef HAVE_TRACING
+ {
+ //defining the last timestamp that we can safely dump to trace file
+ //without losing the event ascending order (considering all CPU's)
+ cpu_Cas01_im_t cpu;
+ xbt_dict_cursor_t cursor;
+ char *key;
+ double smaller = -1;
+ xbt_dict_foreach(surf_model_resource_set(surf_cpu_model), cursor, key, cpu){
+ if (smaller < 0){
+ smaller = cpu->last_update;
+ continue;
+ }
+ if (cpu->last_update < smaller){
+ smaller = cpu->last_update;
+ }
+ }
+ if (smaller > 0) {
+ TRACE_last_timestamp_to_dump = smaller;
+ }
+ }
+#endif
return;
}