Skip to content

Commit 7463476

Browse files
dhruvr4dhruvr4rbuch
authored
Allow SumDetail logs to be used in Animation (#134)
Co-authored-by: dhruvr4 <[email protected]> Co-authored-by: Ronak Buch <[email protected]>
1 parent 03a5d7d commit 7463476

File tree

1 file changed

+25
-81
lines changed

1 file changed

+25
-81
lines changed

src/projections/analysis/IntervalData.java

Lines changed: 25 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -107,83 +107,34 @@ public IntervalData() {
107107
System.out.println("IntervalData - hasSumDetailData + numIntervals: "+numIntervals+" intervalSize: " + intervalSize);
108108
}
109109
}
110-
public void loadSumDetailIntervalData(long intervalSize, int intervalStart,
111-
int intervalEnd,
112-
SortedSet<Integer> processorList){
113-
int numIntervals = intervalEnd - intervalStart + 1;
114-
115-
sumDetailData_interval_EP = new int[numIntervals][numEPs];
116-
sumDetailData_PE_EP = new int[numPEs][numEPs];
117-
sumDetailData_PE_interval = new int[numPEs][numIntervals];
118-
double[][] tempData;
119-
for(Integer curPe : processorList) {
120-
int ii = intervalStart;
121-
tempData = getData(curPe, TYPE_TIME);
122-
for(int i=0; i<numIntervals; i++){
123-
for(int e=0; e<numEPs; e++){
124-
sumDetailData_interval_EP[i][e] += (int)tempData[e][ii];
125-
sumDetailData_PE_EP[curPe][e] += (int)tempData[e][ii];
126-
sumDetailData_PE_interval[curPe][i] += (int)tempData[e][ii];
127-
}
128-
ii++;
129-
}
130-
}
131-
}
132-
/**
133-
* This is a method for use with the older way of doing things only.
134-
* Regretably, it's needed to get things working for now.
135-
*
136-
* The method fills 3 arrays - systemUsageData, systemMsgsData
137-
* and userEntryData
138-
* given time-range specifications.
139-
*/
140-
public void loadIntervalData(long intervalSize, int intervalStart,
141-
int intervalEnd, boolean byEntryPoint,
142-
SortedSet<Integer> processorList) {
143-
int numIntervals = intervalEnd - intervalStart + 1;
144-
systemUsageData = new int[3][processorList.size()][numIntervals];
145-
systemMsgsData = new int[5][3][processorList.size()][numIntervals];
146-
if (byEntryPoint) {
147-
userEntryData =
148-
new int[numEPs][3][processorList.size()][numIntervals];
149-
}
150-
double tempData[][] = null;
151-
int processorCount = 0;
152-
for(Integer curPe : processorList) {
153-
// get standard data
154-
tempData = getData(curPe, TYPE_TIME, intervalSize, intervalStart,
155-
intervalEnd-intervalStart+1);
156-
// copy into userEntryData, if byEntryPoint is true,
157-
// accumulate into systemUsageData.
158-
for (int i=0; i<numIntervals; i++) {
159-
for (int ep=0; ep<numEPs; ep++) {
160-
if (byEntryPoint) {
161-
userEntryData[ep][2][processorCount][i] =
162-
(int)tempData[ep][i];
163-
}
164-
systemUsageData[1][processorCount][i] +=
165-
(int)tempData[ep][i];
166-
}
167-
// after accumulation for systemUsageData, convert to %util
168-
systemUsageData[1][processorCount][i] =
169-
(int)IntervalUtils.timeToUtil(systemUsageData[1][processorCount][i],
170-
intervalSize);
171-
}
172110

173-
// get message data
174-
tempData = getData(curPe, TYPE_NUM_MSGS, intervalSize,
175-
intervalStart, intervalEnd-intervalStart+1);
176-
// accumulate into systemMsgsData
177-
for (int i=0; i<numIntervals; i++) {
178-
for (int ep=0; ep<numEPs; ep++) {
179-
systemMsgsData[1][2][processorCount][i] +=
180-
(int)tempData[ep][i];
111+
public void loadSumDetailIntervalData(long intervalSize, int intervalStart, int intervalEnd,
112+
SortedSet<Integer> processorList) {
113+
int numIntervals = intervalEnd - intervalStart + 1;
114+
115+
sumDetailData_interval_EP = new int[numIntervals][numEPs];
116+
sumDetailData_PE_EP = new int[numPEs][numEPs];
117+
sumDetailData_PE_interval = new int[numPEs][numIntervals];
118+
systemUsageData = new int[3][processorList.size()][numIntervals];
119+
120+
int processorCount = 0;
121+
122+
for (Integer curPe : processorList) {
123+
double[][] tempData = getData(curPe, TYPE_TIME, intervalSize, intervalStart, numIntervals);
124+
for (int i = 0; i < numIntervals; i++) {
125+
for (int ep = 0; ep < numEPs; ep++) {
126+
sumDetailData_interval_EP[i][ep] += (int) tempData[ep][i];
127+
sumDetailData_PE_EP[curPe][ep] += (int) tempData[ep][i];
128+
sumDetailData_PE_interval[curPe][i] += (int) tempData[ep][i];
129+
systemUsageData[1][processorCount][i] += (int) tempData[ep][i];
130+
}
131+
// after accumulation for systemUsageData, convert to utilization percentage (0-100)
132+
systemUsageData[1][processorCount][i] =
133+
(int) IntervalUtils.timeToUtil(systemUsageData[1][processorCount][i], intervalSize);
134+
}
135+
processorCount++;
181136
}
182-
}
183-
184-
processorCount++;
185137
}
186-
}
187138

188139
public int[][] getSumDetailData_interval_EP() {
189140
return sumDetailData_interval_EP;
@@ -201,13 +152,6 @@ public int[][][] getSystemUsageData() {
201152
return systemUsageData;
202153
}
203154

204-
public int[][][][] getSystemMsgs() {
205-
return systemMsgsData;
206-
}
207-
208-
public int[][][][] getUserEntries() {
209-
return userEntryData;
210-
}
211155

212156

213157
/**

0 commit comments

Comments
 (0)