Commit 2edd61bd authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5a25f4ae
...@@ -9,6 +9,10 @@ $(XDAT) : ...@@ -9,6 +9,10 @@ $(XDAT) :
bench : bench_c bench_go bench : bench_c bench_go
bench_copy: t_copy_c t_copy_go
./t_copy_c >t_copy_c.csv
./t_copy_go >t_copy_go.csv
bench_c : t_syspread_c $(XDAT) t_copy_c bench_c : t_syspread_c $(XDAT) t_copy_c
./t_syspread_c $(XDAT) >t_syspread_c.csv ./t_syspread_c $(XDAT) >t_syspread_c.csv
./t_copy_c >t_copy_c.csv ./t_copy_c >t_copy_c.csv
......
...@@ -27,16 +27,16 @@ copy_go = loadxy("t_copy_go.csv") ...@@ -27,16 +27,16 @@ copy_go = loadxy("t_copy_go.csv")
plt.title("Timing for syspread & memcopy") plt.title("Timing for syspread & memcopy")
plotxy(pread_c, label="syspread/c") #plotxy(pread_c, label="syspread/c")
plotxy(pread_go, label="syspread/go") #plotxy(pread_go, label="syspread/go")
plotxy(copy_c, label="copy/c") plotxy(copy_c, label="copy/c")
plotxy(copy_go, label="copy/go") plotxy(copy_go, label="copy/go")
assert pread_c[0] == copy_c[0] #assert pread_c[0] == copy_c[0]
plotxy((pread_c[0], np.array(pread_c[1]) - np.array(copy_c[1])), label="syspread/c - copy/c") #plotxy((pread_c[0], np.array(pread_c[1]) - np.array(copy_c[1])), label="syspread/c - copy/c")
plt.legend() plt.legend()
plt.ylabel('time (ns)') plt.ylabel('time (ns)')
plt.xlabel('buffer size (bytes)') plt.xlabel('buffer size (bytes)')
#plt.show() plt.show()
plt.savefig('syspread.png') #plt.savefig('syspread.png')
...@@ -22,9 +22,9 @@ double microtime() { ...@@ -22,9 +22,9 @@ double microtime() {
} }
// 12345678 // 12345678
#define NITER 1000000 #define NITER 100000
#define BUFSIZE 4096 #define BUFSIZE 64*1024
static char buf[BUFSIZE]; static char buf[BUFSIZE];
static char buf2[BUFSIZE]; static char buf2[BUFSIZE];
...@@ -48,12 +48,12 @@ int main() { ...@@ -48,12 +48,12 @@ int main() {
printf("%ld\t%.1f\n", size, (Tend - Tstart) / NITER / 1E-9); printf("%ld\t%.1f\n", size, (Tend - Tstart) / NITER / 1E-9);
if (size < 16) { if (size < 1024) {
size += 1; // detailed start size += 128; // detailed start
} else if (size < 128) { } else if (size < 8*1024) {
size += 16; size += 256;
} else { } else {
size += 128; size += 512;
} }
} }
} }
0 2.8 0 3.2
1 2.4 128 5.6
2 2.7 256 4.2
3 2.7 384 6.4
4 3.0 512 8.3
5 2.9 640 9.3
6 3.0 768 10.5
7 3.0 896 12.1
8 2.4 1024 13.6
9 2.5 1280 15.7
10 2.5 1536 18.6
11 2.5 1792 21.5
12 2.6 2048 24.4
13 2.6 2304 30.1
14 2.5 2560 32.4
15 2.5 2816 34.3
16 2.4 3072 32.7
32 2.5 3328 35.5
48 2.5 3584 37.8
64 2.1 3840 40.4
80 4.3 4096 43.4
96 2.7 4352 56.7
112 3.5 4608 58.7
128 4.6 4864 58.4
256 3.5 5120 61.1
384 5.3 5376 63.1
512 6.8 5632 65.2
640 7.6 5888 67.5
768 8.7 6144 69.9
896 10.0 6400 72.3
1024 11.2 6656 75.0
1152 12.1 6912 77.0
1280 13.0 7168 79.3
1408 14.2 7424 82.1
1536 15.4 7680 84.1
1664 16.7 7936 86.4
1792 17.8 8192 88.8
1920 18.9 8704 93.8
2048 20.1 9216 98.2
2176 22.4 9728 102.9
2304 24.2 10240 107.7
2432 25.8 10752 114.0
2560 26.6 11264 117.1
2688 27.6 11776 121.8
2816 28.4 12288 126.5
2944 29.6 12800 131.2
3072 30.9 13312 135.9
3200 32.1 13824 140.7
3328 33.4 14336 145.9
3456 34.4 14848 150.1
3584 35.9 15360 154.8
3712 36.6 15872 159.9
3840 38.1 16384 164.6
3968 38.9 16896 169.5
4096 41.0 17408 173.7
17920 180.2
18432 191.6
18944 207.3
19456 208.8
19968 228.3
20480 231.0
20992 250.4
21504 273.9
22016 285.3
22528 283.4
23040 314.9
23552 326.2
24064 343.7
24576 366.6
25088 365.5
25600 349.5
26112 360.2
26624 369.0
27136 382.2
27648 391.7
28160 398.4
28672 404.0
29184 403.7
29696 417.0
30208 424.5
30720 433.0
31232 443.6
31744 454.6
32256 466.0
32768 470.1
33280 477.0
33792 502.5
34304 507.4
34816 512.7
35328 526.8
35840 531.2
36352 524.9
36864 538.7
37376 546.9
37888 558.5
38400 547.9
38912 560.2
39424 578.5
39936 585.7
40448 593.4
40960 597.1
41472 604.7
41984 598.6
42496 604.1
43008 622.3
43520 664.6
44032 661.4
44544 665.8
45056 666.3
45568 669.8
46080 678.6
46592 687.2
47104 691.2
47616 702.5
48128 711.8
48640 720.3
49152 723.1
49664 725.4
50176 733.2
50688 759.3
51200 771.2
51712 788.2
52224 811.3
52736 833.7
53248 819.3
53760 810.9
54272 818.0
54784 815.6
55296 825.8
55808 824.0
56320 831.1
56832 851.1
57344 863.8
57856 865.2
58368 865.8
58880 876.5
59392 887.2
59904 905.3
60416 920.3
60928 927.7
61440 925.2
61952 925.3
62464 954.2
62976 990.2
63488 1002.5
64000 1049.7
64512 1100.6
65024 1079.8
65536 1041.3
0 2.0 0 2.6
1 3.8 128 5.7
2 3.1 256 8.7
3 3.2 384 10.5
4 2.4
5 3.5
6 3.5
7 3.5
8 2.4
9 3.5
10 3.5
11 3.5
12 3.5
13 3.5
14 3.4
15 3.4
16 2.9
32 3.0
48 4.5
64 4.0
80 6.6
96 6.6
112 7.1
128 6.9
256 10.4
384 10.8
512 12.2 512 12.2
640 13.2 640 13.5
768 14.5 768 14.4
896 15.7 896 15.2
1024 16.8 1024 16.3
1152 18.3 1280 18.7
1280 19.3 1536 20.6
1408 20.5 1792 23.9
1536 21.4 2048 25.4
1664 22.8 2304 28.3
1792 24.1 2560 30.8
1920 25.1 2816 33.4
2048 26.0 3072 35.2
2176 27.5 3328 37.5
2304 28.9 3584 39.5
2432 29.6 3840 41.9
2560 31.3 4096 44.6
2688 32.7 4352 47.2
2816 33.5 4608 49.4
2944 34.6 4864 51.4
3072 35.5 5120 54.1
3200 37.0 5376 56.1
3328 38.2 5632 58.8
3456 39.2 5888 61.3
3584 40.8 6144 63.3
3712 41.8 6400 66.3
3840 43.0 6656 68.2
3968 44.0 6912 70.3
4096 45.3 7168 73.6
7424 75.4
7680 78.4
7936 79.8
8192 82.5
8704 87.1
9216 91.8
9728 96.9
10240 101.7
10752 106.0
11264 112.3
11776 116.2
12288 121.1
12800 125.9
13312 130.3
13824 134.4
14336 141.7
14848 148.7
15360 149.0
15872 155.1
16384 172.2
16896 172.4
17408 179.1
17920 228.3
18432 329.6
18944 389.0
19456 417.7
19968 433.6
20480 449.5
20992 469.1
21504 477.9
22016 479.2
22528 516.0
23040 535.3
23552 530.1
24064 533.7
24576 532.2
25088 512.2
25600 513.4
26112 502.6
26624 550.6
27136 539.4
27648 561.1
28160 620.1
28672 550.4
29184 557.4
29696 554.1
30208 547.6
30720 588.3
31232 617.6
31744 607.4
32256 599.0
32768 648.5
33280 643.8
33792 617.3
34304 595.0
34816 666.0
35328 700.9
35840 656.9
36352 714.3
36864 699.3
37376 655.7
37888 704.7
38400 672.1
38912 658.8
39424 699.6
39936 753.4
40448 783.6
40960 754.5
41472 778.1
41984 749.7
42496 761.4
43008 772.0
43520 854.6
44032 830.6
44544 819.5
45056 860.8
45568 844.8
46080 816.9
46592 853.8
47104 883.0
47616 890.1
48128 849.4
48640 895.0
49152 913.8
49664 946.5
50176 898.4
50688 880.0
51200 888.6
51712 910.5
52224 954.9
52736 1005.7
53248 976.1
53760 985.0
54272 961.7
54784 977.5
55296 986.8
55808 1006.3
56320 1021.0
56832 1021.5
57344 1042.4
57856 1112.4
58368 1054.4
58880 990.8
59392 1078.0
59904 1139.9
60416 1123.0
60928 1072.5
61440 994.6
61952 1100.5
62464 1157.0
62976 1097.9
63488 1138.8
64000 1188.8
64512 1226.6
65024 1214.5
65536 1150.0
...@@ -6,9 +6,9 @@ import ( ...@@ -6,9 +6,9 @@ import (
) )
// 12345678 // 12345678
const Niter = 1000000 const Niter = 100000
const BufSize = 4096 const BufSize = 64*1024
var buf [BufSize]byte var buf [BufSize]byte
var buf2 [BufSize]byte var buf2 [BufSize]byte
...@@ -31,12 +31,12 @@ func main() { ...@@ -31,12 +31,12 @@ func main() {
fmt.Printf("%v\t%.1f\n", size, float64(Tend.Sub(Tstart).Nanoseconds()) / Niter) fmt.Printf("%v\t%.1f\n", size, float64(Tend.Sub(Tstart).Nanoseconds()) / Niter)
switch { switch {
case size < 16: case size < 1024:
size += 1 // detailed start size += 128 // detailed start
case size < 128: case size < 8*1024:
size += 16 size += 256
default: default:
size += 128 size += 512
} }
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment