@@ -41,7 +41,7 @@ class OverviewPanel extends ScalePanel.Child
41
41
42
42
// idleData & mergedData (for supporting - utilization for now -
43
43
// the other two data formats)
44
- private int [][] idleDataNormalized ; // [processor idx][interval]
44
+ private byte [][] idleDataNormalized ; // [processor idx][interval]
45
45
private int [][] utilizationDataNormalized ; // [processor idx][interval]
46
46
47
47
private int [][] colors ; //The color per processor per interval
@@ -89,15 +89,16 @@ public String getPointInfo(double time,double procs)
89
89
int interval = (int )(t /intervalSize );
90
90
91
91
long timedisplay = t +startTime ;
92
- if (interval >= entryData [p ].length ) {
93
- return "some bug has occurred" ; // strange bug.
94
- }
92
+
95
93
if (mode == OverviewWindow .MODE_UTILIZATION ) {
96
94
return "Processor " + pe +
97
95
": Usage = " + utilizationDataNormalized [p ][interval ]+"%" +
98
96
" IDLE = " + idleDataNormalized [p ][interval ]+"%" +
99
97
" at " +U .humanReadableString (timedisplay )+" (" +timedisplay +" us). " ;
100
98
} else if (mode == OverviewWindow .MODE_EP ) {
99
+ if (interval >= entryData [p ].length ) {
100
+ return "some bug has occurred" ; // strange bug.
101
+ }
101
102
if (entryData [p ][interval ] > 0 ) {
102
103
return "Processor " +pe +": Usage = " +
103
104
utilizationDataNormalized [p ][interval ]+"%" +
@@ -329,6 +330,9 @@ protected void setRanges(SortedSet<Integer> selectedPEs, long startTime, long en
329
330
330
331
331
332
intervalSize = (int )trialintervalSize ;
333
+ if (MainWindow .runObject [myRun ].hasSumDetailData ()) {
334
+ intervalSize = (int ) MainWindow .runObject [myRun ].getSumDetailIntervalSize ();
335
+ }
332
336
startInterval = (int )(startTime /intervalSize );
333
337
endInterval = (int )(endTime /intervalSize );
334
338
@@ -342,55 +346,67 @@ protected void setRanges(SortedSet<Integer> selectedPEs, long startTime, long en
342
346
* for each interval */
343
347
344
348
protected void loadData (boolean saveImage ) {
345
- if (!MainWindow .runObject [myRun ].hasLogData ()) {
346
- System .err .println ("No log files are available." );
347
- JOptionPane .showMessageDialog (null , "No log files are available." );
348
- return ;
349
- }
350
-
351
349
this .saveImage = saveImage ;
352
- mode = OverviewWindow .MODE_EP ;
353
-
354
- // Create a list of worker threads
355
- LinkedList <Runnable > readyReaders = new LinkedList <Runnable >();
356
-
357
- selectedPEs .size ();
350
+ if (MainWindow .runObject [myRun ].hasLogData ()) {
351
+ int numIntervals = endInterval - startInterval ;
352
+ mode = OverviewWindow .MODE_EP ;
353
+
354
+ // Create a list of worker threads
355
+ LinkedList <Runnable > readyReaders = new LinkedList <Runnable >();
356
+
357
+ entryData = new int [selectedPEs .size ()][numIntervals ];
358
+ int pIdx = 0 ;
359
+ float [][] idleData = new float [selectedPEs .size ()][numIntervals ];
360
+ float [][] utilizationData = new float [selectedPEs .size ()][numIntervals ];
361
+ for (Integer pe : selectedPEs ) {
362
+ readyReaders .add (new ThreadedFileReader (pe , intervalSize , myRun ,
363
+ startInterval , endInterval , entryData [pIdx ], utilizationData [pIdx ], idleData [pIdx ]));
364
+ pIdx ++;
365
+ }
358
366
359
- int numIntervals = endInterval - startInterval ;
360
-
361
- entryData = new int [selectedPEs .size ()][numIntervals ];
362
- float [][] idleData = new float [selectedPEs .size ()][numIntervals ];
363
- float [][] utilizationData = new float [selectedPEs .size ()][numIntervals ];
364
-
365
- int pIdx =0 ;
366
-
367
- for (Integer pe : selectedPEs ){
368
- readyReaders .add ( new ThreadedFileReader (pe , intervalSize , myRun ,
369
- startInterval , endInterval , entryData [pIdx ], utilizationData [pIdx ], idleData [pIdx ]) );
370
- pIdx ++;
371
- }
372
-
373
- // Pass this list of threads to a class that manages/runs the threads nicely
374
- TimedProgressThreadExecutor threadManager = new TimedProgressThreadExecutor ("Loading Overview in Parallel" , readyReaders , this , true );
375
- threadManager .runAll ();
376
-
377
- // For historical reasons, we use a utilization range of 0 to 100
378
- utilizationDataNormalized = new int [utilizationData .length ][utilizationData [0 ].length ];
379
- idleDataNormalized = new int [idleData .length ][idleData [0 ].length ];
380
-
381
- for (int i =0 ; i <utilizationData .length ; i ++) {
382
- for (int j =0 ; j <utilizationData [i ].length ; j ++) {
383
- utilizationDataNormalized [i ][j ] = (int ) (100.0f * utilizationData [i ][j ]);
384
- idleDataNormalized [i ][j ] = (int ) (100.0f * idleData [i ][j ]);
367
+ // Pass this list of threads to a class that manages/runs the threads nicely
368
+ TimedProgressThreadExecutor threadManager = new TimedProgressThreadExecutor ("Loading Overview in Parallel" , readyReaders , this , true );
369
+ threadManager .runAll ();
370
+
371
+ // For historical reasons, we use a utilization range of 0 to 100
372
+ utilizationDataNormalized = new int [utilizationData .length ][utilizationData [0 ].length ];
373
+ idleDataNormalized = new byte [idleData .length ][idleData [0 ].length ];
374
+ for (int i = 0 ; i < utilizationData .length ; i ++) {
375
+ for (int j = 0 ; j < utilizationData [i ].length ; j ++) {
376
+ utilizationDataNormalized [i ][j ] = (int ) (100.0f * utilizationData [i ][j ]);
377
+ idleDataNormalized [i ][j ] = (byte ) (100.0f * idleData [i ][j ]);
378
+ }
379
+ }
380
+ // We default to coloring by entry method for log files
381
+ colorByEntry ();
382
+ } else if (MainWindow .runObject [myRun ].hasSumDetailData ()) {
383
+ int intervalSize = (int ) MainWindow .runObject [myRun ].getSumDetailIntervalSize ();
384
+ startInterval = (int ) startTime / intervalSize ;
385
+ endInterval = (int ) Math .ceil (((double ) endTime ) / intervalSize ) - 1 ;
386
+ int numIntervals = endInterval - startInterval + 1 ;
387
+
388
+ utilizationDataNormalized = new int [selectedPEs .size ()][numIntervals ];
389
+ idleDataNormalized = new byte [selectedPEs .size ()][numIntervals ];
390
+
391
+ MainWindow .runObject [myRun ].LoadGraphData (intervalSize , startInterval , endInterval , false , selectedPEs );
392
+
393
+ utilizationDataNormalized = MainWindow .runObject [myRun ].getSumDetailData_PE_interval ();
394
+ idleDataNormalized = MainWindow .runObject [myRun ].sumAnalyzer .getIdlePercentage ();
395
+ double scale = 100.0 / intervalSize ;
396
+
397
+ // idleDataNormalized is already in terms of percentage, so don't convert it
398
+ for (int i = 0 ; i < utilizationDataNormalized .length ; i ++) {
399
+ for (int j = 0 ; j < utilizationDataNormalized [i ].length - 1 ; j ++) {
400
+ utilizationDataNormalized [i ][j ] = (int ) (scale * utilizationDataNormalized [i ][j ]);
401
+ }
385
402
}
403
+ // Color by utilization for sumdetail
404
+ colorByUtil ();
405
+ } else {
406
+ System .err .println ("Does not work for sum files" );
407
+ JOptionPane .showMessageDialog (null , "Does not work for sum files" );
408
+ return ;
386
409
}
387
-
388
- // dispose of unneeded utilizationData
389
- utilizationData = null ;
390
-
391
- // We default to coloring by entry method
392
- colorByEntry ();
393
-
394
410
}
395
411
396
412
protected void colorByEntry () {
0 commit comments