Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 65 additions & 49 deletions src/projections/Tools/Overview/OverviewPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class OverviewPanel extends ScalePanel.Child

// idleData & mergedData (for supporting - utilization for now -
// the other two data formats)
private int[][] idleDataNormalized; // [processor idx][interval]
private byte[][] idleDataNormalized; // [processor idx][interval]
private int[][] utilizationDataNormalized; // [processor idx][interval]

private int[][] colors; //The color per processor per interval
Expand Down Expand Up @@ -89,15 +89,16 @@ public String getPointInfo(double time,double procs)
int interval = (int)(t/intervalSize);

long timedisplay = t+startTime;
if (interval >= entryData[p].length) {
return "some bug has occurred"; // strange bug.
}

if (mode == OverviewWindow.MODE_UTILIZATION) {
return "Processor " + pe +
": Usage = " + utilizationDataNormalized[p][interval]+"%" +
" IDLE = " + idleDataNormalized[p][interval]+"%" +
" at "+U.humanReadableString(timedisplay)+" ("+timedisplay+" us). ";
} else if(mode == OverviewWindow.MODE_EP) {
if (interval >= entryData[p].length) {
return "some bug has occurred"; // strange bug.
}
if (entryData[p][interval] > 0) {
return "Processor "+pe+": Usage = "+
utilizationDataNormalized[p][interval]+"%"+
Expand Down Expand Up @@ -329,6 +330,9 @@ protected void setRanges(SortedSet<Integer> selectedPEs, long startTime, long en


intervalSize = (int )trialintervalSize;
if (MainWindow.runObject[myRun].hasSumDetailData()) {
intervalSize = (int) MainWindow.runObject[myRun].getSumDetailIntervalSize();
}
startInterval = (int)(startTime/intervalSize);
endInterval = (int)(endTime/intervalSize);

Expand All @@ -342,55 +346,67 @@ protected void setRanges(SortedSet<Integer> selectedPEs, long startTime, long en
* for each interval */

protected void loadData(boolean saveImage) {
if (!MainWindow.runObject[myRun].hasLogData()) {
System.err.println("No log files are available.");
JOptionPane.showMessageDialog(null, "No log files are available.");
return;
}

this.saveImage = saveImage;
mode = OverviewWindow.MODE_EP;

// Create a list of worker threads
LinkedList<Runnable> readyReaders = new LinkedList<Runnable>();

selectedPEs.size();
if (MainWindow.runObject[myRun].hasLogData()) {
int numIntervals = endInterval - startInterval;
mode = OverviewWindow.MODE_EP;

// Create a list of worker threads
LinkedList<Runnable> readyReaders = new LinkedList<Runnable>();

entryData = new int[selectedPEs.size()][numIntervals];
int pIdx = 0;
float[][] idleData = new float[selectedPEs.size()][numIntervals];
float[][] utilizationData = new float[selectedPEs.size()][numIntervals];
for (Integer pe : selectedPEs) {
readyReaders.add(new ThreadedFileReader(pe, intervalSize, myRun,
startInterval, endInterval, entryData[pIdx], utilizationData[pIdx], idleData[pIdx]));
pIdx++;
}

int numIntervals = endInterval - startInterval;

entryData = new int[selectedPEs.size()][numIntervals];
float[][] idleData = new float[selectedPEs.size()][numIntervals];
float[][] utilizationData = new float[selectedPEs.size()][numIntervals];

int pIdx=0;

for(Integer pe : selectedPEs){
readyReaders.add( new ThreadedFileReader(pe, intervalSize, myRun,
startInterval, endInterval, entryData[pIdx], utilizationData[pIdx], idleData[pIdx]) );
pIdx++;
}

// Pass this list of threads to a class that manages/runs the threads nicely
TimedProgressThreadExecutor threadManager = new TimedProgressThreadExecutor("Loading Overview in Parallel", readyReaders, this, true);
threadManager.runAll();

// For historical reasons, we use a utilization range of 0 to 100
utilizationDataNormalized = new int[utilizationData.length][utilizationData[0].length];
idleDataNormalized = new int[idleData.length][idleData[0].length];

for (int i=0; i<utilizationData.length; i++) {
for (int j=0; j<utilizationData[i].length; j++) {
utilizationDataNormalized[i][j] = (int) (100.0f * utilizationData[i][j]);
idleDataNormalized[i][j] = (int) (100.0f * idleData[i][j]);
// Pass this list of threads to a class that manages/runs the threads nicely
TimedProgressThreadExecutor threadManager = new TimedProgressThreadExecutor("Loading Overview in Parallel", readyReaders, this, true);
threadManager.runAll();

// For historical reasons, we use a utilization range of 0 to 100
utilizationDataNormalized = new int[utilizationData.length][utilizationData[0].length];
idleDataNormalized = new byte[idleData.length][idleData[0].length];
for (int i = 0; i < utilizationData.length; i++) {
for (int j = 0; j < utilizationData[i].length; j++) {
utilizationDataNormalized[i][j] = (int) (100.0f * utilizationData[i][j]);
idleDataNormalized[i][j] = (byte) (100.0f * idleData[i][j]);
}
}
// We default to coloring by entry method for log files
colorByEntry();
} else if (MainWindow.runObject[myRun].hasSumDetailData()) {
int intervalSize = (int) MainWindow.runObject[myRun].getSumDetailIntervalSize();
startInterval = (int) startTime / intervalSize;
endInterval = (int) Math.ceil(((double) endTime) / intervalSize) - 1;
int numIntervals = endInterval - startInterval + 1;

utilizationDataNormalized = new int[selectedPEs.size()][numIntervals];
idleDataNormalized = new byte[selectedPEs.size()][numIntervals];

MainWindow.runObject[myRun].LoadGraphData(intervalSize, startInterval, endInterval, false, selectedPEs);

utilizationDataNormalized = MainWindow.runObject[myRun].getSumDetailData_PE_interval();
idleDataNormalized = MainWindow.runObject[myRun].sumAnalyzer.getIdlePercentage();
double scale = 100.0 / intervalSize;

// idleDataNormalized is already in terms of percentage, so don't convert it
for (int i = 0; i < utilizationDataNormalized.length; i++) {
for (int j = 0; j < utilizationDataNormalized[i].length - 1; j++) {
utilizationDataNormalized[i][j] = (int) (scale * utilizationDataNormalized[i][j]);
}
}
// Color by utilization for sumdetail
colorByUtil();
} else {
System.err.println("Does not work for sum files");
JOptionPane.showMessageDialog(null, "Does not work for sum files");
return;
}

// dispose of unneeded utilizationData
utilizationData = null;

// We default to coloring by entry method
colorByEntry();

}

protected void colorByEntry() {
Expand Down
34 changes: 19 additions & 15 deletions src/projections/Tools/Overview/OverviewWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,29 @@ private void createLayout()
scalePanel.setStatusDisplay(this);


colorByEntryMethod = new JRadioButton("Entry Method");
colorByUtil = new JRadioButton("Utilization");
colorByEntryMethod.setSelected(true);
//Group the radio buttons.
ButtonGroup group = new ButtonGroup();
group.add(colorByEntryMethod);
group.add(colorByUtil);
colorByEntryMethod.addActionListener(this);
colorByUtil.addActionListener(this);
JPanel radioPanel = new JPanel();
radioPanel.setLayout(new GridBagLayout());
mChooseColors = new JButton("Choose Entry Method Colors");
mChooseColors.addActionListener(this);

Util.gblAdd(radioPanel, new JLabel("Color By:"), gbc, 0,0, 1,1, 1,1);
Util.gblAdd(radioPanel, colorByEntryMethod, gbc, 1,0, 1,1, 1,1);
Util.gblAdd(radioPanel, colorByUtil, gbc, 2,0, 1,1, 1,1);
ButtonGroup group = new ButtonGroup();
JPanel radioPanel = new JPanel();
radioPanel.setLayout(new GridBagLayout());
Util.gblAdd(radioPanel, new JLabel("Color By:"), gbc, 0,0, 1,1, 1,1);

if(MainWindow.runObject[myRun].hasLogFiles()){
colorByEntryMethod = new JRadioButton("Entry Method");
colorByEntryMethod.setSelected(true);
group.add(colorByEntryMethod);
colorByEntryMethod.addActionListener(this);
Util.gblAdd(radioPanel, colorByEntryMethod, gbc, 1,0, 1,1, 1,1);
}

colorByUtil = new JRadioButton("Utilization");
group.add(colorByUtil);
colorByUtil.addActionListener(this);
if(MainWindow.runObject[myRun].hasSumDetailFiles()){
colorByUtil.setSelected(true);
}

Util.gblAdd(radioPanel, colorByUtil, gbc, 2,0, 1,1, 1,1);
gbc.fill = GridBagConstraints.HORIZONTAL;
Util.gblAdd(windowPane, radioPanel, gbc, 0,3, 1,1, 0,0, 1,1,1,1);
Util.gblAdd(windowPane, mChooseColors, gbc, 1,3, 1,1, 0,0, 1,1,1,1);
Expand Down
2 changes: 1 addition & 1 deletion src/projections/Tools/TimeProfile/TimeProfileWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ else if( MainWindow.runObject[myRun].hasSumDetailFiles()) //Bilge
MainWindow.runObject[myRun].LoadGraphData(intervalSize, startInterval, endInterval, false,
processorList);

int[][] sumDetailData = MainWindow.runObject[myRun].getSumDetailData();
int[][] sumDetailData = MainWindow.runObject[myRun].getSumDetailData_interval_EP();

for(int i=0;i<numIntervals;i++){
//for(int j=0;j<numEPs+special;j++){
Expand Down
14 changes: 10 additions & 4 deletions src/projections/analysis/Analysis.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.awt.Paint;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Iterator;
import java.util.SortedSet;
import java.util.TreeSet;
Expand Down Expand Up @@ -359,9 +358,16 @@ public double getSumDetailNumIntervals(){
return intervalData.getNumIntervals();
}

public int[][] getSumDetailData() {
return intervalData.sumDetailData();
public int[][] getSumDetailData_interval_EP() {
return intervalData.getSumDetailData_interval_EP();
}
public int[][] getSumDetailData_PE_EP() {
return intervalData.getSumDetailData_PE_EP();
}
public int[][] getSumDetailData_PE_interval() {
return intervalData.getSumDetailData_PE_interval();
}

public Color getEntryColor(int entryIdx) {
if (entryIdx == IDLE_ENTRY_POINT) {
Paint p = getIdleColor();
Expand Down Expand Up @@ -444,7 +450,7 @@ else if (hasSumDetailFiles()) {
intervalStart,
intervalEnd, false, peSet);

int sumDetailData[][] = intervalData.sumDetailData();
int sumDetailData[][] = intervalData.getSumDetailData_interval_EP();
data = new long[numUserEntries];
for (int interval = 0; interval < numIntervals; interval++) {
for (int entry = 0; entry < numUserEntries; entry++) {
Expand Down
24 changes: 20 additions & 4 deletions src/projections/analysis/IntervalData.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ public class IntervalData
private int numIntervals = 0;
private double intervalSize = 0;

private int sumDetailData[][] = null;
private int sumDetailData_interval_EP[][] = null;
private int sumDetailData_PE_EP[][] = null;
private int sumDetailData_PE_interval[][] = null;

/**
* The constructor
Expand Down Expand Up @@ -110,14 +112,18 @@ public void loadSumDetailIntervalData(long intervalSize, int intervalStart,
SortedSet<Integer> processorList){
int numIntervals = intervalEnd - intervalStart + 1;

sumDetailData = new int[numIntervals][numEPs];
sumDetailData_interval_EP = new int[numIntervals][numEPs];
sumDetailData_PE_EP = new int[numPEs][numEPs];
sumDetailData_PE_interval = new int[numPEs][numIntervals];
double[][] tempData;
for(Integer curPe : processorList) {
int ii = intervalStart;
tempData = getData(curPe, TYPE_TIME);
for(int i=0; i<numIntervals; i++){
for(int e=0; e<numEPs; e++){
sumDetailData[i][e] += tempData[e][ii];
sumDetailData_interval_EP[i][e] += (int)tempData[e][ii];
sumDetailData_PE_EP[curPe][e] += (int)tempData[e][ii];
sumDetailData_PE_interval[curPe][i] += (int)tempData[e][ii];
}
ii++;
}
Expand Down Expand Up @@ -179,7 +185,17 @@ public void loadIntervalData(long intervalSize, int intervalStart,
}
}

public int[][] sumDetailData() {return sumDetailData; };
public int[][] getSumDetailData_interval_EP() {
return sumDetailData_interval_EP;
}

public int[][] getSumDetailData_PE_EP() {
return sumDetailData_PE_EP;
}

public int[][] getSumDetailData_PE_interval() {
return sumDetailData_PE_interval;
}

public int[][][] getSystemUsageData() {
return systemUsageData;
Expand Down
3 changes: 3 additions & 0 deletions src/projections/analysis/SumAnalyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -635,4 +635,7 @@ public int[] getTotalIdlePercentage(){
}
return totalIdlePercentage;
}
public byte[][] getIdlePercentage(){
return IdlePercentage;
}
}