Skip to content

Commit 72a11e2

Browse files
committed
Communication Per PE: Add "Node External" views
1 parent 8f5c515 commit 72a11e2

File tree

2 files changed

+73
-10
lines changed

2 files changed

+73
-10
lines changed

src/projections/Tools/CommunicationPerPE/CommWindow.java

+53-9
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public class CommWindow extends GenericGraphWindow
4646
private double[][] receivedByteCount;
4747
private double[][] externalRecv;
4848
private double[][] externalBytesRecv;
49+
private double[][] externalNodeRecv;
50+
private double[][] externalNodeBytesRecv;
4951
private int[][] hopCount;
5052
private double[][] avgHopCount;
5153
private double[][] avgPeHopCount;
@@ -74,6 +76,8 @@ public class CommWindow extends GenericGraphWindow
7476
private Checkbox receivedBytes;
7577
private Checkbox recvExternal;
7678
private Checkbox recvExternalBytes;
79+
private Checkbox recvExternalNode;
80+
private Checkbox recvExternalNodeBytes;
7781
private Checkbox hopCountCB;
7882
private Checkbox peHopCountCB;
7983

@@ -146,15 +150,27 @@ public void itemStateChanged(ItemEvent ae){
146150
setXAxis("Processor", peList);
147151
super.refreshGraph();
148152
}else if(cb == recvExternal){
149-
setDataSource("Rate of Msgs Received Externally", externalRecv, this);
153+
setDataSource("Rate of External Msgs Received", externalRecv, this);
150154
setPopupText("externalRecv");
151-
setYAxis("Rate of Messages Received Externally", "");
155+
setYAxis("Rate of External Messages Received", "");
152156
setXAxis("Processor", peList);
153157
super.refreshGraph();
154158
} else if(cb == recvExternalBytes){
155-
setDataSource("Rate of Bytes Received Externally", externalBytesRecv, this);
159+
setDataSource("Rate of External Bytes Received", externalBytesRecv, this);
156160
setPopupText("externalBytesRecv");
157-
setYAxis("Rate of Bytes Received Externally", "");
161+
setYAxis("Rate of External Bytes Received", "");
162+
setXAxis("Processor", peList);
163+
super.refreshGraph();
164+
} else if (cb == recvExternalNode) {
165+
setDataSource("Rate of Node External Msgs Received", externalNodeRecv, this);
166+
setPopupText("externalNodeRecv");
167+
setYAxis("Rate of Node External Messages Received", "");
168+
setXAxis("Processor", peList);
169+
super.refreshGraph();
170+
} else if (cb == recvExternalNodeBytes) {
171+
setDataSource("Rate of Node External Bytes Received", externalNodeBytesRecv, this);
172+
setPopupText("externalNodeBytesRecv");
173+
setYAxis("Rate of Node External Bytes Received", "");
158174
setXAxis("Processor", peList);
159175
super.refreshGraph();
160176
} else if (cb == hopCountCB) {
@@ -201,6 +217,8 @@ private void scaleHistogramData(double newUnit) {
201217
receivedByteCount[pIdx][ep] *= scale;
202218
externalRecv[pIdx][ep] *= scale;
203219
externalBytesRecv[pIdx][ep] *= scale;
220+
externalNodeRecv[pIdx][ep] *= scale;
221+
externalNodeBytesRecv[pIdx][ep] *= scale;
204222
}
205223
}
206224
unitTime = newUnit;
@@ -267,6 +285,20 @@ public String[] getPopup(int xVal, int yVal){
267285
unitTimeStr,
268286
_format.format(externalBytesRecv[xVal][yVal]*timeInterval/unitTime));
269287
rString[3] = "Processor = " + xAxis.getIndexName(xVal);
288+
} else if(currentArrayName.equals("externalNodeRecv")) {
289+
rString[1] = "EPid: " + a.getEntryNameByIndex(yVal);
290+
rString[2] = String.format("Rate = %s messages/%s (%s messages)",
291+
_format.format(externalNodeRecv[xVal][yVal]),
292+
unitTimeStr,
293+
_format.format(externalNodeRecv[xVal][yVal]*timeInterval/unitTime));
294+
rString[3] = "Processor = " + xAxis.getIndexName(xVal);
295+
} else if(currentArrayName.equals("externalNodeBytesRecv")) {
296+
rString[1] = "EPid: " + a.getEntryNameByIndex(yVal);
297+
rString[2] = String.format("Rate = %s B/%s (%s bytes)",
298+
_format.format(externalNodeBytesRecv[xVal][yVal]),
299+
unitTimeStr,
300+
_format.format(externalNodeBytesRecv[xVal][yVal]*timeInterval/unitTime));
301+
rString[3] = "Processor = " + xAxis.getIndexName(xVal);
270302
} else if (currentArrayName.equals("avgHopCount")) {
271303
rString[1] = "EPid: " + a.getEntryNameByIndex(yVal);
272304
rString[2] = String.format("Rate = %s hops/%s (%s hops)",
@@ -319,10 +351,11 @@ private void createLayout() {
319351
sentBytes = new Checkbox("Bytes Sent To", cbg, false);
320352
receivedMsgs = new Checkbox("Msgs Recv By", cbg, false);
321353
receivedBytes = new Checkbox("Bytes Recv By", cbg, false);
322-
recvExternal = new Checkbox("External Msgs Recv By", cbg,
323-
false);
324-
recvExternalBytes = new Checkbox("External Bytes Recv By", cbg,
325-
false);
354+
recvExternal = new Checkbox("External Msgs Recv By", cbg, false);
355+
recvExternalBytes = new Checkbox("External Bytes Recv By", cbg, false);
356+
recvExternalNode = new Checkbox("Node External Msgs Recv By", cbg, false);
357+
recvExternalNodeBytes = new Checkbox("Node External Bytes Recv By", cbg, false);
358+
326359

327360
if (MainWindow.BLUEGENE) {
328361
hopCountCB = new Checkbox("Avg Hop Count (EP)", cbg, false);
@@ -336,6 +369,8 @@ private void createLayout() {
336369
receivedBytes.addItemListener(this);
337370
recvExternal.addItemListener(this);
338371
recvExternalBytes.addItemListener(this);
372+
recvExternalNode.addItemListener(this);
373+
recvExternalNodeBytes.addItemListener(this);
339374
if (MainWindow.BLUEGENE) {
340375
hopCountCB.addItemListener(this);
341376
peHopCountCB.addItemListener(this);
@@ -348,6 +383,8 @@ private void createLayout() {
348383
Util.gblAdd(checkBoxPanel, receivedBytes, gbc, 3,0, 1,1, 1,1);
349384
Util.gblAdd(checkBoxPanel, recvExternal, gbc, 4,0, 1,1, 1,1);
350385
Util.gblAdd(checkBoxPanel, recvExternalBytes, gbc, 5,0, 1,1, 1,1);
386+
Util.gblAdd(checkBoxPanel, recvExternalNode, gbc, 6,0, 1,1, 1,1);
387+
Util.gblAdd(checkBoxPanel, recvExternalNodeBytes, gbc, 7,0, 1,1, 1,1);
351388

352389
if (MainWindow.BLUEGENE) {
353390
Util.gblAdd(blueGenePanel, hopCountCB, gbc, 0,0, 1,1, 1,1);
@@ -424,6 +461,8 @@ private void getData(long startTime, long endTime, SortedSet<Integer> pes){
424461
receivedByteCount = new double[pes.size()][];
425462
externalRecv = new double[pes.size()][];
426463
externalBytesRecv = new double[pes.size()][];
464+
externalNodeRecv = new double[pes.size()][];
465+
externalNodeBytesRecv = new double[pes.size()][];
427466
if (MainWindow.BLUEGENE) {
428467
hopCount = new int[pes.size()][];
429468
} else {
@@ -438,7 +477,12 @@ private void getData(long startTime, long endTime, SortedSet<Integer> pes){
438477
LinkedList<Runnable> readyReaders = new LinkedList<Runnable>();
439478
int pIdx = 0;
440479
for(Integer nextPe : pes){
441-
readyReaders.add( new ThreadedFileReader(nextPe, pIdx, startTime, endTime, sentMsgCount, sentByteCount, receivedMsgCount, receivedByteCount, externalRecv, externalBytesRecv, hopCount ) );
480+
readyReaders.add(new ThreadedFileReader(nextPe, pIdx, startTime, endTime,
481+
sentMsgCount, sentByteCount,
482+
receivedMsgCount, receivedByteCount,
483+
externalRecv, externalBytesRecv,
484+
externalNodeRecv, externalNodeBytesRecv,
485+
hopCount));
442486
pIdx++;
443487
}
444488

src/projections/Tools/CommunicationPerPE/ThreadedFileReader.java

+20-1
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,22 @@ class ThreadedFileReader extends ThreadedFileReaderBase implements Runnable {
2626
private double[][] receivedByteCount;
2727
private double[][] externalRecv;
2828
private double[][] externalBytesRecv;
29+
private double[][] externalNodeRecv;
30+
private double[][] externalNodeBytesRecv;
2931
private int[][] hopCount;
3032

3133
private boolean isCommThd;
3234

3335
public ArrayList<Integer> localHistogram = new ArrayList<Integer>();
3436

3537
/** Construct a file reading thread that will generate data for one PE. */
36-
protected ThreadedFileReader(int pe, int pIdx, long startTime, long endTime, double[][] sentMsgCount, double[][] sentByteCount, double[][] receivedMsgCount, double[][] receivedByteCount, double[][] externalRecv, double[][] externalBytesRecv, int[][] hopCount ){
38+
protected ThreadedFileReader(int pe, int pIdx, long startTime, long endTime,
39+
double[][] sentMsgCount, double[][] sentByteCount,
40+
double[][] receivedMsgCount, double[][] receivedByteCount,
41+
double[][] externalRecv, double[][] externalBytesRecv,
42+
double[][] externalNodeRecv, double[][] externalNodeBytesRecv,
43+
int[][] hopCount)
44+
{
3745
this.pe = pe;
3846
this.pIdx = pIdx;
3947
this.startTime = startTime;
@@ -45,6 +53,8 @@ protected ThreadedFileReader(int pe, int pIdx, long startTime, long endTime, dou
4553
this.receivedByteCount = receivedByteCount;
4654
this.externalRecv = externalRecv;
4755
this.externalBytesRecv = externalBytesRecv;
56+
this.externalNodeRecv = externalNodeRecv;
57+
this.externalNodeBytesRecv = externalNodeBytesRecv;
4858
this.hopCount = hopCount;
4959

5060
StsReader sts = MainWindow.runObject[myRun].getSts();
@@ -72,6 +82,8 @@ public void run() {
7282
receivedByteCount[pIdx] = new double[numEPs];
7383
externalRecv[pIdx] = new double[numEPs];
7484
externalBytesRecv[pIdx] = new double[numEPs];
85+
externalNodeRecv[pIdx] = new double[numEPs];
86+
externalNodeBytesRecv[pIdx] = new double[numEPs];
7587
if (MainWindow.BLUEGENE) {
7688
hopCount[pIdx] = new int[numEPs];
7789
}
@@ -116,6 +128,11 @@ public void run() {
116128
CommWindow.manhattanDistance(pe,logdata.pe);
117129
}
118130
}
131+
// If the send was from outside the node
132+
if (!isSameNode(pe, logdata.pe)) {
133+
externalNodeRecv[pIdx][EPid]++;
134+
externalNodeBytesRecv[pIdx][EPid] += logdata.msglen;
135+
}
119136

120137
if(isCommThd){
121138
//process the messages' count for communication threads
@@ -148,6 +165,8 @@ public void run() {
148165
receivedByteCount[pIdx][ep] /= timeInterval;
149166
externalRecv[pIdx][ep] /= timeInterval;
150167
externalBytesRecv[pIdx][ep] /= timeInterval;
168+
externalNodeRecv[pIdx][ep] /= timeInterval;
169+
externalNodeBytesRecv[pIdx][ep] /= timeInterval;
151170
}
152171
} catch (IOException e) {
153172
System.out.println("Exception: " +e);

0 commit comments

Comments
 (0)