next up previous
Next: Big Network Simulation Up: Postmortem Simulation Previous: POSE

Timestamp Correction

For the timestamp correction simulation, we read the trace log files generated by the BigSim emulator. An application execution was emulated on some configuration, and all the tasks and their dependencies are recorded in these logs. In our simulation, we recreate entities in POSE to model the processors and nodes of the emulation. We then read in the tasks and use the simulation to pretend to execute them. For each task, we know what it depends on, what depends on it, the duration of the task, and what other tasks were generated by it and when these other tasks were generated (as an offset from the current task's start time). We also have an estimate of network latency which we use to determine how much time generated tasks spend in transit to the processor on which they will be executed.

Figure 3: Feigned task execution in POSE.
\begin{figure}\centering\scriptsize {
\begin{verbatim}executeTask(task)
if (t...
...t;
end
end
end
end\end{verbatim}\vspace{-10pt}
}
\vspace{-10pt}
\end{figure}

What we don't know is exactly when each task started (though we do have an uncorrected timestamp for each task), and without that information, we do not know how the application that was emulated performed. Given the information above, we start the first task off at virtual time zero, and let the tasks ``execute'' and record the virtual time at which each task starts. The algorithm for this feigned execution is shown in Figure 3.

When a task executes, it first checks to make sure that all its dependencies have been met, i.e. all tasks on which it depends have been executed. If they have, then it is time to execute this task. We make a backup copy of this task's incorrect timestamp (for calculating offsets of generated tasks later) and record the processor's current virtual time as the task's correct start time. Then we invoke executeTask for all of this task's generated tasks, calculating the start time for each by offsetting the correct start time for this task by the same offset as before.

Next, we elapse the local virtual time by the duration of the task and mark it done. Now it is safe to enable any tasks that were dependent on this one. The algorithm goes through all the dependents, and if a dependent is enabled (it is not dependent on any other unexecuted tasks), it can be executed immediately.

When all tasks have been executed, they should have correct timestamps and the final GVT should represent a correct runtime for the emulated application.


next up previous
Next: Big Network Simulation Up: Postmortem Simulation Previous: POSE
Gengbin Zheng 2004-01-21