Skip to content

Commit 209c1b2

Browse files
Anirudh Manojrbuch
authored andcommitted
Add phases to projections, add menu options for phase and range config, implement phases to RangeDialog
Change-Id: I59b16437ff1afabc2b86d373db61cbd3abde5ed5
1 parent d210d3e commit 209c1b2

File tree

11 files changed

+1702
-108
lines changed

11 files changed

+1702
-108
lines changed

src/projections/Tools/TimeProfile/ThreadedFileReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import projections.gui.MainWindow;
99

1010
/** The reader threads for Time Profile tool. This class ought to be generalized for all the other tools needing similar functionality. */
11-
class ThreadedFileReader implements Runnable {
11+
public class ThreadedFileReader implements Runnable {
1212

1313
private int pe;
1414
// int p; // Which index am I into the flattened array of potentially sparse pe's
@@ -38,7 +38,7 @@ class ThreadedFileReader implements Runnable {
3838
* @param intervalSize
3939
* @param phaseMarkers
4040
* */
41-
protected ThreadedFileReader(int pe, long intervalSize, int myRun, int startInterval, int endInterval,
41+
public ThreadedFileReader(int pe, long intervalSize, int myRun, int startInterval, int endInterval,
4242
TreeMap<Double, String> phaseMarkers, double[][] graphData){
4343
this.phaseMarkers = phaseMarkers;
4444
this.pe = pe;

src/projections/Tools/TimeProfile/TimeProfileWindow.java

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
import projections.analysis.ProjMain;
2424
import projections.analysis.TimedProgressThreadExecutor;
2525
import projections.gui.Clickable;
26-
import projections.gui.GenericGraphColorer;
2726
import projections.gui.GenericGraphWindow;
2827
import projections.gui.IntervalChooserPanel;
2928
import projections.gui.JPanelToImage;
3029
import projections.gui.MainWindow;
3130
import projections.gui.RangeDialog;
31+
import projections.gui.TimeProfileColorer;
3232
import projections.gui.U;
3333
import projections.gui.Util;
3434

@@ -508,45 +508,6 @@ public void done() {
508508
}
509509
}
510510

511-
512-
513-
/** A class that provides the colors for the display */
514-
public class TimeProfileColorer implements GenericGraphColorer {
515-
int myRun = 0;
516-
int outSize;
517-
int numIntervals;
518-
519-
TimeProfileColorer(int outSize, int numIntervals){
520-
this.outSize = outSize;
521-
this.numIntervals = numIntervals;
522-
}
523-
524-
public Paint[] getColorMap() {
525-
Paint[] outColors = new Paint[outSize];
526-
for (int i=0; i<numIntervals; i++) {
527-
int count = 0;
528-
for (int ep=0; ep<numEPs+special; ep++) {
529-
if (stateArray[ep]) {
530-
outputData[i][count] = graphData[i][ep];
531-
if(ep == numEPs){
532-
outColors[count++] = MainWindow.runObject[myRun].getOverheadColor();
533-
}
534-
else if (ep == numEPs+1){
535-
outColors[count++] = MainWindow.runObject[myRun].getIdleColor();
536-
}
537-
else
538-
outColors[count++] = MainWindow.runObject[myRun].getEPColorMap()[ep];
539-
}
540-
}
541-
}
542-
543-
return outColors;
544-
}
545-
546-
}
547-
548-
549-
550511
private void setOutputGraphData() {
551512
// need first pass to decide the size of the outputdata
552513
int outSize = 0;
@@ -572,7 +533,7 @@ private void setOutputGraphData() {
572533
setYAxis("Percentage Utilization", "%");
573534
String xAxisLabel = "Time (" + U.humanReadableString(intervalSize) + " resolution)";
574535
setXAxis(xAxisLabel, "Time", startTime, intervalSize);
575-
setDataSource("Time Profile", outputData, new TimeProfileColorer(outSize, numIntervals), thisWindow);
536+
setDataSource("Time Profile", outputData, new TimeProfileColorer(outSize, numIntervals, numEPs, outputData, graphData, stateArray), thisWindow);
576537
graphCanvas.setMarkers(phaseMarkers);
577538
refreshGraph();
578539
}

src/projections/analysis/Pair.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package projections.analysis;
2+
3+
public class Pair {
4+
private long start, end;
5+
6+
public Pair(long x, long y) {
7+
start = x;
8+
end = y;
9+
}
10+
11+
public void setEnd(long end) {
12+
this.end = end;
13+
}
14+
15+
public void setStart(long start) {
16+
this.start = start;
17+
}
18+
19+
public long getEnd() {
20+
return end;
21+
}
22+
23+
public long getStart() {
24+
return start;
25+
}
26+
}

0 commit comments

Comments
 (0)