4.3 Power Trace Visualisation
4.3.2 Visualisation: Displays and Animations
4.3.2.1 Control
The PSim PTV bundle provides a collection of control mechanisms for inter- acting with users as well as “tuning” the presented trace data. PSim can display trace data in terms of their absolute timings i.e. the actual period when the monitoring took place, as well as display them in relative timings. This allows a user to pinpoint an exact timing at which a process took place and be able to relate this information to the corresponding resource usage information.
Figure 4.7: PSim PTV bundle - graphical visualisation of power trace data from monitoring workload Fast Fourier Transform using containerand ccp. The data view focuses on the status of the monitoring workload against its run time and they are displayed as block representations.
Also to allow browsing trace data easily, PSim is equipped with a scroll bar at the bottom of the visualisation interface and a corresponding “drag- gable” reference line at the visualisation area. These features are depicted in figure 4.6, the red line in the middle of figure 4.6 is the so-called “drag- gable” reference line and the scroll bar is shown in the bottom of the user interface. The visualisation area provided by the PSim PTVbundle is also a cursor detection area, allowing a real time update of power, CPU and mem- ory information. A snapshot of this is shown in figure 4.8. The update is carried out according to the cursor position on the visualisation area and its
Figure 4.8: A snapshot depicting real time update of power, CPU and mem- ory information at the visualisation area of PSim PTV bundle according to cursor position and its relation to the position of actual visualised trace data. relation to the position of actual visualised trace data.
Data Synchronisation - As explained in secton 4.3.1 about the com-
pilation of the trace file, current/power measurements from monitoring an applications are data-logged by a seperate workstation due to the incompati- bility between the experimental platform and the interface software and since running another application on the experimental platform when monitoring a workload induces overhead, while the resource information such as CPU and memory usage are stored on the experimental platform. This creates a possibility of the data being out-of-sync due to the difference in the timing information of these data from two different platforms. AlthoughPComposer
is used to merge these data into a single trace file, it is far more effective to carry out data synchronisation visually and consequently PSim has been implemented to include this functionality. It allows synchronisation can be carried out either manually or automatically. The two methods are explained as follows:
1 float cpua,cpub,powera,powerb;
2 int i = tracedata.size()-1; int cme = 0; int pme = ec; 3 int cms = 0; int pms = bc;
4
5 // Search for the start and end of data fluctuation 6 while (i>0) {
7 cpua = (float) tracedata.getgCPUValue(i); // CPU value at i 8 cpub = (float) tracedata.getgCPUValue(i-1); // CPU value at i-1 9 powera = (float) tracedata.getPowerValue(i); // Power value at i 10 powerb = (float) tracedata.getPowerValue(i-1); // Power value at i-1 11 if (pme == 0 || cme == 0) {
12 if (cme == 0 && cpua == 0.0 && cpub > 0.0) cme = i; 13 if (tracedata.isCentiSecond()) {
14 if (pme == 0 && powera < 2.0 && powerb > 2.0 ) pme = i; 15 } else {
16 if (pme == 0 && powera < 30.0 && powerb > 30.0 ) pme = i;
17 }
18 }
19 if (pme > 0 && cme > 0) break;
20 i--;
21 }
22
23 if (pme == 0) pme = tracedata.size()-1; 24 if (cme == 0) cme = tracedata.size()-1; 25
26 i=0;
27 while (i<tracedata.size()) {
28 cpua = (float) tracedata.getgCPUValue(i);// CPU value at i
29 cpub = (float) tracedata.getgCPUValue(i+1); // CPU value at i+1 30 powera = (float) tracedata.getPowerValue(i); // Power value at i 31 powerb = (float) tracedata.getPowerValue(i+1); // Power value at i+1 32 if (cms == 0 || pms == 0) {
33 if (cms == 0 && cpua == 0.0 && cpub > 0.0) cms = i; 34 if (tracedata.isCentiSecond()) {
35 if (pms == 0 && powera < 2.0 && powerb > 2.0 ) pms = i; 36 } else {
37 if (pms == 0 && powera < 30.0 && powerb > 50.0 ) pms = i;
38 }
39 }
41 i++;
42 }
Listing 4.22: An excerpt of the methodsynchronizeinTrace.javashowing the algorithm for locating the start and end of data fluctuation.
Figure 4.9: A snapshot depicting the line representation visualisation of trace data from monitoring a bubble sort algorithm before data synchronisation.
• Manual Synchronisation - This technique leverages the cursor detec- tion and “draggable” reference line functions in PSim. User visually determines two points on the visualisation area which represent when the monitoring session began and ended, this is usually shown by the start and end of the current/power measurements’ line representations. User drags the reference line or double-click at these points and select
Figure 4.10: A snapshot depicting the line representation visualisation of trace data from monitoring a bubble sort algorithm after data synchronisa- tion of the line representation visualisation in figure 4.9.
synchronise on the PSimPTVbundle interface to commence data syn- chronisation. Figures 4.9 and 4.10 show line representation visualisa- tions of trace data from monitoring a bubble sort algorithm before and after data synchronisation respectively.
• Automatic Synchronisation - This technique employs an algorithm that examines either the power/current measurements data or both the CPU and memory usage data. The algorithm determines the start and end of the current/power measurements by first determining the mean value of the data given and then recognising data fluctuation according to the data deviation from this mean value. Listing 4.22 is an excerpt of
the methodsynchronizeinTrace.javashowing the algorithm imple- mentation for locating the start and end of data fluctuation. Trace is the implementation class for encapsulating individual trace file and it includes a static method for automatically synchronising each Trace
object.