diff options
author | leochanj105 <leochanj@live.unc.edu> | 2020-10-20 21:55:11 -0400 |
---|---|---|
committer | leochanj105 <leochanj@live.unc.edu> | 2020-10-20 21:55:11 -0400 |
commit | e2d933df44b7b387b41c8c7805393ad3857c4448 (patch) | |
tree | 35cbeee7b13ff92e3cb09e2bef5128a558ec39f1 /dis | |
parent | a32f220f06cc463e5b56e7fa0b1b1334d94d08f3 (diff) | |
parent | e2b50015cebdfba68699abd6e8575e38230f5a78 (diff) |
Merge branch 'sd-vbs' of ssh://rtsrv.cs.unc.edu/public/mc2-scripts-and-benchmarks into sd-vbs
Diffstat (limited to 'dis')
-rw-r--r-- | dis/Field/field.c | 14 | ||||
-rwxr-xr-x | dis/Matrix/ver2/matrix.c | 6 | ||||
-rw-r--r-- | dis/Neighborhood/neighborhood.c | 33 | ||||
-rw-r--r-- | dis/Pointer/pointer.c | 9 | ||||
-rw-r--r-- | dis/Transitive/transitive.c | 10 | ||||
-rw-r--r-- | dis/Update/update.c | 4 | ||||
-rwxr-xr-x | dis/run_all_dis.sh | 70 |
7 files changed, 43 insertions, 103 deletions
diff --git a/dis/Field/field.c b/dis/Field/field.c index 900d47b..d028ee7 100644 --- a/dis/Field/field.c +++ b/dis/Field/field.c | |||
@@ -137,17 +137,17 @@ int main(int argc, char **argv) { | |||
137 | } | 137 | } |
138 | endTime = time(NULL); | 138 | endTime = time(NULL); |
139 | 139 | ||
140 | volatile int sumAll = 0; | 140 | volatile int _stop_optimizer = 0; |
141 | for (l = 0; l < n; l++) { | 141 | for (l = 0; l < n; l++) { |
142 | unsigned int ll; | 142 | unsigned int ll; |
143 | // fprintf(stdout, "%d subfields for token %d \n", token[l].subfields, l); | 143 | //fprintf(stdout, "%d subfields for token %d \n", token[l].subfields, l); |
144 | sumAll += token[l].subfields + l; | 144 | _stop_optimizer += token[l].subfields + l; |
145 | for (ll = 0; ll < token[l].subfields; ll++) { | 145 | for (ll = 0; ll < token[l].subfields; ll++) { |
146 | sumAll += ll + token[l].stat[ll].count + token[l].stat[ll].min + | 146 | _stop_optimizer += ll + token[l].stat[ll].count + token[l].stat[ll].min + |
147 | token[l].stat[ll].sum; | 147 | token[l].stat[ll].sum; |
148 | /*fprintf(stdout, "subfields %d:\tcount = %d\tmin= %x\tsum= %x\n", | 148 | //fprintf(stdout, "subfields %d:\tcount = %d\tmin= %x\tsum= %x\n", |
149 | ll, token[l].stat[ll].count, | 149 | // ll, token[l].stat[ll].count, |
150 | token[l].stat[ll].min, token[l].stat[ll].sum);*/ | 150 | // token[l].stat[ll].min, token[l].stat[ll].sum);*/ |
151 | } | 151 | } |
152 | } | 152 | } |
153 | fprintf(stderr, "time for field stressmark = %f seconds.\n", | 153 | fprintf(stderr, "time for field stressmark = %f seconds.\n", |
diff --git a/dis/Matrix/ver2/matrix.c b/dis/Matrix/ver2/matrix.c index 5162579..9d9ac7e 100755 --- a/dis/Matrix/ver2/matrix.c +++ b/dis/Matrix/ver2/matrix.c | |||
@@ -551,8 +551,10 @@ int main(int argc, char **argv) { | |||
551 | sum += sum + *(vectorX + k); | 551 | sum += sum + *(vectorX + k); |
552 | } | 552 | } |
553 | 553 | ||
554 | fprintf(stdout, "sum = %f, actualError = %e, actualIteration = %d\n", sum, | 554 | //fprintf(stdout, "sum = %f, actualError = %e, actualIteration = %d\n", sum, |
555 | actualError, actualIteration); | 555 | // actualError, actualIteration); |
556 | volatile double _stop_optimizer = sum + actualError + actualIteration; | ||
557 | |||
556 | fprintf(stderr, "time for matrix stressmark = %f seconds.\n", | 558 | fprintf(stderr, "time for matrix stressmark = %f seconds.\n", |
557 | difftime(endTime, beginTime)); | 559 | difftime(endTime, beginTime)); |
558 | 560 | ||
diff --git a/dis/Neighborhood/neighborhood.c b/dis/Neighborhood/neighborhood.c index 2d401d3..ea1c658 100644 --- a/dis/Neighborhood/neighborhood.c +++ b/dis/Neighborhood/neighborhood.c | |||
@@ -74,23 +74,30 @@ int main(int argc, char **argv) { | |||
74 | endTime = time(NULL); | 74 | endTime = time(NULL); |
75 | WRITE_TO_FILE | 75 | WRITE_TO_FILE |
76 | 76 | ||
77 | // printf(" end time is %d\n", endTime); | 77 | volatile double _stop_optimizer = values.distShort.deg0.entropy |
78 | + values.distShort.deg0.energy + values.distShort.deg45.entropy | ||
79 | + values.distShort.deg45.energy + values.distShort.deg90.entropy | ||
80 | + values.distShort.deg90.energy + values.distShort.deg135.entropy | ||
81 | + values.distShort.deg135.energy + values.distLong.deg0.entropy | ||
82 | + values.distLong.deg0.energy + values.distShort.deg45.entropy | ||
83 | + values.distLong.deg45.energy + values.distLong.deg90.entropy | ||
84 | + values.distLong.deg90.energy + values.distLong.deg135.entropy | ||
85 | + values.distLong.deg135.energy; | ||
86 | //fprintf(stdout, "%9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e", | ||
87 | // values.distShort.deg0.entropy, values.distShort.deg0.energy, | ||
88 | // values.distShort.deg45.entropy, values.distShort.deg45.energy, | ||
89 | // values.distShort.deg90.entropy, values.distShort.deg90.energy, | ||
90 | // values.distShort.deg135.entropy, values.distShort.deg135.energy); | ||
78 | 91 | ||
79 | fprintf(stdout, "%9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e", | 92 | //fprintf(stdout, "%9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e", |
80 | values.distShort.deg0.entropy, values.distShort.deg0.energy, | 93 | // values.distLong.deg0.entropy, values.distLong.deg0.energy, |
81 | values.distShort.deg45.entropy, values.distShort.deg45.energy, | 94 | // values.distShort.deg45.entropy, values.distLong.deg45.energy, |
82 | values.distShort.deg90.entropy, values.distShort.deg90.energy, | 95 | // values.distLong.deg90.entropy, values.distLong.deg90.energy, |
83 | values.distShort.deg135.entropy, values.distShort.deg135.energy); | 96 | // values.distLong.deg135.entropy, values.distLong.deg135.energy); |
84 | |||
85 | fprintf(stdout, "%9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e %9.4e", | ||
86 | values.distLong.deg0.entropy, values.distLong.deg0.energy, | ||
87 | values.distShort.deg45.entropy, values.distLong.deg45.energy, | ||
88 | values.distLong.deg90.entropy, values.distLong.deg90.energy, | ||
89 | values.distLong.deg135.entropy, values.distLong.deg135.energy); | ||
90 | 97 | ||
91 | fprintf(stderr, "time for neghborhood stressmark = %f seconds.\n", | 98 | fprintf(stderr, "time for neghborhood stressmark = %f seconds.\n", |
92 | difftime(endTime, beginTime)); | 99 | difftime(endTime, beginTime)); |
93 | 100 | ||
94 | free((Pixel *)image); | 101 | free((Pixel *)image); |
95 | return (SUCCESS); | 102 | return (0); |
96 | } | 103 | } |
diff --git a/dis/Pointer/pointer.c b/dis/Pointer/pointer.c index d97f276..0325c64 100644 --- a/dis/Pointer/pointer.c +++ b/dis/Pointer/pointer.c | |||
@@ -146,10 +146,11 @@ int main(int argc, char **argv) { | |||
146 | 146 | ||
147 | endTime = time(NULL); | 147 | endTime = time(NULL); |
148 | 148 | ||
149 | volatile int _stop_optimizer = thread[l].hops + l; | 149 | volatile int _stop_optimizer = 0; |
150 | /*for (l=0; l<n; l++){ | 150 | for (l=0; l<n; l++){ |
151 | fprintf(stdout, "%lu hops on thread %d\n", thread[l].hops, l); | 151 | _stop_optimizer += thread[l].hops + l; |
152 | }*/ | 152 | // fprintf(stdout, "%lu hops on thread %d\n", thread[l].hops, l); |
153 | } | ||
153 | 154 | ||
154 | fprintf(stderr, "time for pointer stressmark = %f seconds.\n", | 155 | fprintf(stderr, "time for pointer stressmark = %f seconds.\n", |
155 | difftime(endTime, startTime)); | 156 | difftime(endTime, startTime)); |
diff --git a/dis/Transitive/transitive.c b/dis/Transitive/transitive.c index 9337aad..0679f7e 100644 --- a/dis/Transitive/transitive.c +++ b/dis/Transitive/transitive.c | |||
@@ -47,7 +47,6 @@ int main(int argc, char **argv) { | |||
47 | 47 | ||
48 | time_t startTime, stopTime; | 48 | time_t startTime, stopTime; |
49 | unsigned int sum; | 49 | unsigned int sum; |
50 | volatile int realRes = 0; | ||
51 | 50 | ||
52 | assert(fscanf(stdin, "%d %d %d", &n, &m, &seed) == 3); | 51 | assert(fscanf(stdin, "%d %d %d", &n, &m, &seed) == 3); |
53 | 52 | ||
@@ -100,14 +99,15 @@ int main(int argc, char **argv) { | |||
100 | 99 | ||
101 | stopTime = time(NULL); | 100 | stopTime = time(NULL); |
102 | 101 | ||
102 | volatile int _stop_optimizer = 0; | ||
103 | for (j = 0; j < n; j++) { | 103 | for (j = 0; j < n; j++) { |
104 | sum = 0; | 104 | sum = 0; |
105 | for (i = 0; i < n; i++) { | 105 | for (i = 0; i < n; i++) { |
106 | if (*(din + j * n + i) != NO_PATH) | 106 | if (*(din + j * n + i) != NO_PATH) |
107 | sum += *(din + j * n + i); | 107 | sum += *(din + j * n + i); |
108 | } | 108 | } |
109 | realRes += sum; | 109 | _stop_optimizer += sum; |
110 | // fprintf(stdout, "%u ", sum); | 110 | //fprintf(stdout, "%u ", sum); |
111 | } | 111 | } |
112 | for (i = 0; i < n; i++) { | 112 | for (i = 0; i < n; i++) { |
113 | sum = 0; | 113 | sum = 0; |
@@ -115,8 +115,8 @@ int main(int argc, char **argv) { | |||
115 | if (*(din + j * n + i) != NO_PATH) | 115 | if (*(din + j * n + i) != NO_PATH) |
116 | sum += *(din + j * n + i); | 116 | sum += *(din + j * n + i); |
117 | } | 117 | } |
118 | realRes += sum; | 118 | _stop_optimizer += sum; |
119 | // fprintf(stdout, "%u ", sum); | 119 | //fprintf(stdout, "%u ", sum); |
120 | } | 120 | } |
121 | fprintf(stderr, "time for transitive stressmark = %f seconds.\n", | 121 | fprintf(stderr, "time for transitive stressmark = %f seconds.\n", |
122 | difftime(stopTime, startTime)); | 122 | difftime(stopTime, startTime)); |
diff --git a/dis/Update/update.c b/dis/Update/update.c index b7bf2b5..a41f3e1 100644 --- a/dis/Update/update.c +++ b/dis/Update/update.c | |||
@@ -134,10 +134,10 @@ int main(int argc, char **argv) { | |||
134 | endTime = time(NULL); | 134 | endTime = time(NULL); |
135 | 135 | ||
136 | volatile int _stop_optimizer = hops; | 136 | volatile int _stop_optimizer = hops; |
137 | // fprintf(stdout, "%u hops\n", hops); | 137 | //fprintf(stdout, "%u hops\n", hops); |
138 | fprintf(stderr, "time for update stressmark = %f seconds.\n", | 138 | fprintf(stderr, "time for update stressmark = %f seconds.\n", |
139 | difftime(endTime, startTime)); | 139 | difftime(endTime, startTime)); |
140 | free(field); | 140 | free(field); |
141 | WRITE_TO_FILE | 141 | WRITE_TO_FILE |
142 | return (1); | 142 | return (0); |
143 | } | 143 | } |
diff --git a/dis/run_all_dis.sh b/dis/run_all_dis.sh deleted file mode 100755 index 5a6b6e1..0000000 --- a/dis/run_all_dis.sh +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # Run baselines for all the DIS tasks | ||
3 | if [ "$EUID" -ne 0 ] | ||
4 | then | ||
5 | echo "You need to be root to enable cache way and interrupt isolation!" | ||
6 | exit | ||
7 | fi | ||
8 | |||
9 | if uname -a | grep -q "mc2"; then | ||
10 | echo "MC^2 detected! Cache isolation will be enabled" | ||
11 | iso="i" | ||
12 | else | ||
13 | echo "MC^2 not detected." | ||
14 | iso="xi" | ||
15 | fi | ||
16 | |||
17 | datestring=$(date +"%b%d-%H") | ||
18 | if ! grep -q irqaffinity /proc/cmdline; then | ||
19 | /playpen/move_interrupts_off_core15.sh | ||
20 | else | ||
21 | echo "performance" > /sys/devices/system/cpu/cpu15/cpufreq/scaling_governor | ||
22 | fi | ||
23 | WSSS=WSSS_maxstride2mb | ||
24 | caches=caches_all | ||
25 | # Consider re-enabling this only if you're interested in exploring bandwidth effects | ||
26 | #./setup_mem_and_global.sh | ||
27 | if [[ $1 == "--contend" ]]; then | ||
28 | echo "Will run 6 contending tasks" | ||
29 | echo "Files will be named $datestring-<benchmark name>-c-"$iso".txt" | ||
30 | echo "Please verify the above settings. Press enter to continue..." | ||
31 | read | ||
32 | # Run two contending tasks on each other CCX | ||
33 | taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher & | ||
34 | taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher & | ||
35 | taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher & | ||
36 | taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher & | ||
37 | taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher & | ||
38 | taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher & | ||
39 | ./run_dis.sh 15 10 $datestring-field-c-$iso Field inputs/Field/in0 inputs/$WSSS inputs/$caches | ||
40 | ./postproc.sh $datestring-field-c-$iso | ||
41 | ./run_dis.sh 15 10 $datestring-matrix-c-$iso Matrix inputs/Matrix/in0 inputs/$WSSS inputs/$caches | ||
42 | ./postproc.sh $datestring-matrix-c-$iso | ||
43 | ./run_dis.sh 15 10 $datestring-neighborhood-c-$iso Neighborhood inputs/Neighborhood/in0 inputs/$WSSS inputs/$caches | ||
44 | ./postproc.sh $datestring-neighborhood-c-$iso | ||
45 | ./run_dis.sh 15 10 $datestring-pointer-c-$iso Pointer inputs/Pointer/in0 inputs/$WSSS inputs/$caches | ||
46 | ./postproc.sh $datestring-pointer-c-$iso | ||
47 | ./run_dis.sh 15 10 $datestring-transitive-c-$iso Transitive inputs/Transitive/in0 inputs/$WSSS inputs/$caches | ||
48 | ./postproc.sh $datestring-transitive-c-$iso | ||
49 | ./run_dis.sh 15 10 $datestring-update-c-$iso Update inputs/Update/in0 inputs/$WSSS inputs/$caches | ||
50 | ./postproc.sh $datestring-update-c-$iso | ||
51 | killall thrasher | ||
52 | else | ||
53 | echo "Will run no contending tasks (use --contend for contending tasks)" | ||
54 | echo "Files will be named $datestring-<benchmark name>-xc-"$iso".txt" | ||
55 | echo "Please verify the above settings. Press enter to continue..." | ||
56 | read | ||
57 | killall thrasher | ||
58 | ./run_dis.sh 15 10 $datestring-field-xc-$iso Field inputs/Field/in0 inputs/$WSSS inputs/$caches | ||
59 | ./postproc.sh $datestring-field-xc-$iso | ||
60 | ./run_dis.sh 15 10 $datestring-matrix-xc-$iso Matrix inputs/Matrix/in0 inputs/$WSSS inputs/$caches | ||
61 | ./postproc.sh $datestring-matrix-xc-$iso | ||
62 | ./run_dis.sh 15 10 $datestring-neighborhood-xc-$iso Neighborhood inputs/Neighborhood/in0 inputs/$WSSS inputs/$caches | ||
63 | ./postproc.sh $datestring-neighborhood-xc-$iso | ||
64 | ./run_dis.sh 15 10 $datestring-pointer-xc-$iso Pointer inputs/Pointer/in0 inputs/$WSSS inputs/$caches | ||
65 | ./postproc.sh $datestring-pointer-xc-$iso | ||
66 | ./run_dis.sh 15 10 $datestring-transitive-xc-$iso Transitive inputs/Transitive/in0 inputs/$WSSS inputs/$caches | ||
67 | ./postproc.sh $datestring-transitive-xc-$iso | ||
68 | ./run_dis.sh 15 10 $datestring-update-xc-$iso Update inputs/Update/in0 inputs/$WSSS inputs/$caches | ||
69 | ./postproc.sh $datestring-update-xc-$iso | ||
70 | fi | ||