Skip to content

Commit 66c085a

Browse files
committed
Performance and bug fixes
BUG FIXES - Some gather / scatter count metrics were short. - Other cnt (non-g/s) is now the number of window instance not all exe instances. Removing this improves performance of gs_patterns runtime.
1 parent 9aa6b81 commit 66c085a

File tree

1 file changed

+43
-14
lines changed

1 file changed

+43
-14
lines changed

gs_patterns.c

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -426,15 +426,44 @@ int main(int argc, char ** argv) {
426426
}
427427
maddr_prev = maddr;
428428
}
429-
430-
for (j=0; j<w_cnt[w][i]; j++) {
431-
432-
if (gs == -1) {
433-
other_cnt++;
434-
continue;
429+
430+
if (gs == -1) {
431+
432+
//check if this was a gather
433+
if (w == 0) {
434+
435+
for(k=0; k<NGS; k++) {
436+
437+
//end
438+
if (gather_iaddrs[k] == 0)
439+
break;
440+
441+
if (gather_iaddrs[k] == w_iaddrs[w][i]) {
442+
gs = 0;
443+
break;
444+
}
445+
}
446+
447+
//check if this was a scatter
448+
} else {
449+
450+
for(k=0; k<NGS; k++) {
451+
452+
//end
453+
if (scatter_iaddrs[k] == 0)
454+
break;
455+
456+
if (scatter_iaddrs[k] == w_iaddrs[w][i]) {
457+
gs = 1;
458+
break;
459+
}
460+
}
435461
}
436462
}
437463

464+
if (gs == -1)
465+
other_cnt++;
466+
438467
did_record = 0;
439468
if (gs == 0) {
440469

@@ -696,20 +725,20 @@ int main(int argc, char ** argv) {
696725
if (giaddrs_nosym || siaddrs_nosym) {
697726
printf("\n");
698727
printf("IGNORED NONSYMBOL STATS:\n");
699-
printf("gather iaddrs: %16ld\n", giaddrs_nosym);
700-
printf("gather indices: %16ld (%5.2f%c of 1st pass gathers)\n",
728+
printf("gather unique iaddrs: %16ld\n", giaddrs_nosym);
729+
printf("gather total indices: %16ld (%5.2f%c of 1st pass gathers)\n",
701730
gindices_nosym,
702731
100.0 * (double)gindices_nosym / (double)(gindices_nosym + gindices_sym),'%');
703-
printf("scatter iaddrs: %16ld\n", siaddrs_nosym);
704-
printf("scatter indices: %16ld (%5.2f%c of 1st pass scatters)\n",
732+
printf("scatter unique iaddrs: %16ld\n", siaddrs_nosym);
733+
printf("scatter total indices: %16ld (%5.2f%c of 1st pass scatters)\n",
705734
sindices_nosym,
706735
100.0 * (double)sindices_nosym / (double)(sindices_nosym + sindices_sym),'%');
707736
printf("\n");
708737
printf("KEPT SYMBOL STATS:\n");
709-
printf("gather iaddrs: %16ld\n", giaddrs_sym);
710-
printf("gather indices: %16ld\n", gindices_sym);
711-
printf("scatter iaddrs: %16ld\n", siaddrs_sym);
712-
printf("scatter indices: %16ld\n", sindices_sym);
738+
printf("gather unique iaddrs: %16ld\n", giaddrs_sym);
739+
printf("gather total indices: %16ld\n", gindices_sym);
740+
printf("scatter unique iaddrs: %16ld\n", siaddrs_sym);
741+
printf("scatter total indices: %16ld\n", sindices_sym);
713742
}
714743
#endif
715744

0 commit comments

Comments
 (0)