Benchmark Results for <I>pmatrix.module</I>

Benchmark Results for pmatrix.module 400 1

(For questions about these benchmarks send eMail to Claudio Fleiner)

This is the "real" Matrix Multiplaktion program pmatrix.sa running in parallel on a 4 processor Sparc running in parallel on a 4 processor Sparc. It multiplies two 400x400 matrices. Note that the equivalent C (matrix.c) and threaded C (pmatrix.c) are nearly an order of magnitude slower, unless they are optimized by hand (opt_matrix.c and popt_matrix.c).

Program compiler optimized hand optimizedinitialization timecalculation timespeedup
Sather 33.8 n/a1.0 32.8
pSather 14.0 n/a1.2 12.82.6
C 147.0 32.31.231.1
C + threads42.0 13.91.312.62.5

The reason for the non linear speedup is due to memory and cache effects. In fact, to get linear speedup the inner loops of the matrix multiplikation funtion have to make better usage of the cache.

The C and C++ version were compiled with GCC 2.7.1 and -O3.

Note that GCC cannot do much better without inter procedural analysis, as it has to prove that each write to one of the elements of the matrix does not change the size of any of the matrices involed, which could happen if the memory region of the three matrices overlap.

Table of Contents

General Results:

# [#] Compiler Options *Best Run* Size of Executable Compile Time Memory Usage
Inline Move
while!
Once
Args.
Hoist
Invar.
CSE *sec. *% of
std
KB Shorter
in %
sec. % of
std
KB % of
std
1. Standard Compiler with no options 150.70100.0%3200.0%13.45100.0%7736.52100.0%
2. [31]13.709.1%17744.6%23.47174.5%12091.39156.3%
3. [23] 13.809.2%17644.8%22.89170.2%11657.22150.7%
4. [26] 14.009.3%17744.5%23.87177.5%12560.79162.4%
5. [19] 14.009.3%17744.6%23.15172.1%11649.02150.6%
6. [18] 14.109.4%17744.6%23.11171.8%10831.46140.0%
7. [27] 14.109.4%17744.4%23.64175.8%11868.84153.4%
8. [22] 15.0010.0%17644.8%22.78169.4%11275.61145.7%
9. [30] 15.3010.2%17744.6%23.43174.2%10301.44133.2%
10. [29] 41.2027.3%17644.7%19.90148.0%11598.23149.9%
11. [21] 41.2027.3%17644.9%18.81139.9%9711.62125.5%
12. [20] 41.3027.4%17644.9%18.77139.6%10469.38135.3%
13. [24] 41.8027.7%17744.5%19.49144.9%10399.74134.4%
14. [28] 42.1027.9%17644.7%19.26143.2%10153.16131.2%
15. [16] 42.1027.9%17644.7%18.76139.5%10441.52135.0%
16. [25] 44.5029.5%17744.5%19.78147.1%11612.16150.1%
17. [17] 44.7029.7%17644.7%18.83140.0%9777.15126.4%
18. [05] 61.1040.5%17146.5%16.90125.7%9578.09123.8%
19. [04] 61.1040.5%17146.5%16.92125.8%8407.45108.7%
20. [13] 61.2040.6%17146.3%17.52130.3%9836.13127.1%
21. [12] 61.2040.6%17146.3%17.72131.7%10582.43136.8%
22. [07] 61.4040.7%17146.5%18.47137.3%9916.42128.2%
23. [02] 61.6040.9%17146.3%18.56138.0%10537.37136.2%
24. [00] 61.8041.0%17146.3%16.89125.6%9546.14123.4%
25. [08] 61.9041.1%17246.1%17.67131.4%10529.18136.1%
26. [11] 62.0041.1%17246.1%18.88140.4%9486.34122.6%
27. [10] 62.1041.2%17246.1%19.09141.9%10134.32131.0%
28. [03] 62.2041.3%17146.3%18.59138.2%9575.08123.8%
29. [15] 62.5041.5%17146.3%18.74139.3%9458.48122.3%
30. [01] 66.1043.9%17146.3%16.87125.4%9589.56124.0%
31. [14] 66.1043.9%17146.3%18.53137.8%9076.74117.3%
32. [09] 66.2043.9%17246.1%17.50130.1%9632.43124.5%
33. [06] 66.3044.0%17146.5%18.34136.4%10086.81130.4%

Impact of the option "Inlining":

# [# / #] Compiler Options *Best Run* Size of Executable Compile Time Memory Usage
Inline Move
while!
Once
Args.
Hoist
Invar.
CSE Faster
in sec.
*Faster
in % *
Shorter
in KB
Shorter
in %
Slower
in sec.
Slower
in %
change
in KB
change
in %
1. [15/31]48.8078.08%-5-3.09%4.7325.24%-2632908-27.84%
2. [07/23] 47.6077.52%-5-3.05%4.4223.93%-1740800-17.55%
3. [03/19] 48.2077.49%-5-3.04%4.5624.53%-2073941-21.66%
4. [10/26] 48.1077.46%-5-3.06%4.7825.04%-2426470-23.94%
5. [06/22] 51.3077.38%-5-3.06%4.4424.21%-1188795-11.79%
6. [11/27] 47.9077.26%-5-3.06%4.7625.21%-2382506-25.12%
7. [02/18] 47.5077.11%-5-3.09%4.5524.52%-294092-2.79%
8. [14/30] 50.8076.85%-5-3.09%4.9026.44%-1224704-13.49%
9. [09/25] 21.7032.78%-5-2.91%2.2813.03%-1979733-20.55%
10. [13/29] 20.0032.68%-5-2.93%2.3813.58%-1762099-17.91%
11. [05/21] 19.9032.57%-5-2.95%1.9111.30%-133529-1.39%
12. [08/24] 20.1032.47%-5-2.95%1.8210.30%1294331.23%
13. [04/20] 19.8032.41%-5-2.95%1.8510.93%-2061926-24.52%
14. [01/17] 21.4032.38%-5-2.94%1.9611.62%-187596-1.96%
15. [00/16] 19.7031.88%-5-2.93%1.8711.07%-895385-9.38%
16. [12/28] 19.1031.21%-5-2.94%1.548.69%4292604.06%

Impact of the option "Moving while! and until!":

# [# / #] Compiler Options *Best Run* Size of Executable Compile Time Memory Usage
Inline Move
while!
Once
Args.
Hoist
Invar.
CSE Faster
in sec.
*Faster
in % *
Shorter
in KB
Shorter
in %
Slower
in sec.
Slower
in %
change
in KB
change
in %
1. [23/31]0.100.72%0-0.36%0.582.53%-434176-3.72%
2. [16/24] 0.300.71%0-0.34%0.733.89%417790.40%
3. [18/26] 0.100.71%0-0.33%0.763.29%-1729331-15.97%
4. [17/25] 0.200.45%0-0.33%0.955.05%-1835008-18.77%
5. [03/11] 0.200.32%0-0.34%0.291.56%887460.93%
6. [06/14] 0.200.30%0-0.33%0.191.04%101007310.01%
7. [21/29] 0.000.00%0-0.32%1.095.79%-1886617-19.43%
8. [01/09] -0.10-0.15%0-0.35%0.633.73%-42871-0.45%
9. [00/08] -0.10-0.16%0-0.33%0.784.62%-983040-10.30%
10. [05/13] -0.10-0.16%0-0.34%0.623.67%-258048-2.69%
11. [04/12] -0.10-0.16%0-0.33%0.804.73%-2174976-25.87%
12. [19/27] -0.10-0.71%0-0.36%0.492.12%-219818-1.89%
13. [02/10] -0.50-0.81%0-0.36%0.532.86%4030463.82%
14. [07/15] -1.10-1.79%0-0.32%0.271.46%4579324.62%
15. [20/28] -0.80-1.94%0-0.32%0.492.61%3162113.02%
16. [22/30] -0.30-2.00%0-0.36%0.652.85%9741658.64%

Impact of the option "Hoisting Iter Initialization":

# [# / #] Compiler Options *Best Run* Size of Executable Compile Time Memory Usage
Inline Move
while!
Once
Args.
Hoist
Invar.
CSE Faster
in sec.
*Faster
in % *
Shorter
in KB
Shorter
in %
Slower
in sec.
Slower
in %
change
in KB
change
in %
1. [17/21] 3.507.83%00.33%-0.02-0.11%655360.67%
2. [01/05] 5.007.56%00.35%0.030.18%114680.12%
3. [09/13] 5.007.55%00.36%0.020.11%-203707-2.11%
4. [25/29] 3.307.42%00.35%0.120.61%139260.12%
5. [27/31]0.402.84%00.34%-0.17-0.72%-222549-1.88%
6. [16/20] 0.801.90%00.33%0.010.05%-27852-0.27%
7. [19/23] 0.201.43%00.35%-0.26-1.12%-8192-0.07%
8. [03/07] 0.801.29%00.35%-0.12-0.65%-341333-3.56%
9. [00/04] 0.701.13%00.35%0.030.18%113868811.93%
10. [08/12] 0.701.13%00.35%0.050.28%-53248-0.51%
11. [24/28] -0.30-0.72%00.36%-0.23-1.18%2465792.37%
12. [11/15] -0.50-0.81%00.38%-0.14-0.74%278520.29%
13. [18/22] -0.90-6.38%00.37%-0.33-1.43%-444142-4.10%
14. [10/14] -4.00-6.44%00.38%-0.56-2.93%105758710.44%
15. [02/06] -4.70-7.63%00.35%-0.22-1.19%4505604.28%
16. [26/30] -1.30-9.29%00.34%-0.44-1.84%225935317.99%

Impact of the option "Hoisting Loop Invariants":

# [# / #] Compiler Options *Best Run* Size of Executable Compile Time Memory Usage
Inline Move
while!
Once
Args.
Hoist
Invar.
CSE Faster
in sec.
*Faster
in % *
Shorter
in KB
Shorter
in %
Slower
in sec.
Slower
in %
change
in KB
change
in %
1. [17/19] 30.7068.68%0-0.14%4.3222.94%-1871872-19.15%
2. [25/27] 30.4068.31%0-0.17%3.8619.51%-256682-2.21%
3. [29/31]27.5066.75%0-0.18%3.5717.94%-493158-4.25%
4. [16/18] 28.0066.51%0-0.16%4.3523.19%-389939-3.73%
5. [24/26] 27.8066.51%0-0.14%4.3822.47%-2161049-20.78%
6. [21/23] 27.4066.50%0-0.13%4.0821.69%-1945600-20.03%
7. [20/22] 26.3063.68%0-0.12%4.0121.36%-806229-7.70%
8. [28/30] 26.8063.66%0-0.16%4.1721.65%-148275-1.46%
9. [09/11] 4.206.34%0-0.03%1.387.89%1460901.52%
10. [01/03] 3.905.90%0-0.04%1.7210.20%144720.15%
11. [00/02] 0.200.32%0-0.01%1.679.89%-991232-10.38%
12. [08/10] -0.20-0.32%0-0.04%1.428.04%3948543.75%
13. [05/07] -0.30-0.49%0-0.04%1.579.29%-338329-3.53%
14. [13/15] -1.30-2.12%0-0.02%1.226.96%3776513.84%
15. [12/14] -4.90-8.01%0-0.01%0.814.57%150568914.23%
16. [04/06] -5.20-8.51%0-0.01%1.428.39%-1679360-19.97%

Impact of the option "Common Subexpression Elimination":

# [# / #] Compiler Options *Best Run* Size of Executable Compile Time Memory Usage
Inline Move
while!
Once
Args.
Hoist
Invar.
CSE Faster
in sec.
*Faster
in % *
Shorter
in KB
Shorter
in %
Slower
in sec.
Slower
in %
change
in KB
change
in %
1. [30/31]1.6010.46%0-0.01%0.040.17%-1789952-17.38%
2. [22/23] 1.208.00%0-0.01%0.110.48%-381610-3.38%
3. [06/07] 4.907.39%0-0.02%0.130.71%1703931.69%
4. [14/15] 3.605.45%0-0.01%0.211.13%-381747-4.21%
5. [28/29] 0.902.14%00.00%0.643.32%-1445068-14.23%
6. [18/19] 0.100.71%00.01%0.040.17%-817561-7.55%
7. [20/21] 0.100.24%00.00%0.040.21%7577607.24%
8. [10/11] 0.100.16%0-0.01%-0.21-1.10%6479876.39%
9. [04/05] 0.000.00%0-0.00%-0.02-0.12%-1170636-13.92%
10. [12/13] 0.000.00%0-0.01%-0.20-1.13%7462917.05%
11. [26/27] -0.10-0.71%0-0.01%-0.23-0.96%6919505.51%
12. [02/03] -0.60-0.97%0-0.03%0.030.16%9622869.13%
13. [16/17] -2.60-6.18%0-0.00%0.070.37%6643716.36%
14. [24/25] -2.70-6.46%00.01%0.291.49%-1212416-11.66%
15. [08/09] -4.30-6.95%0-0.02%-0.17-0.96%8967508.52%
16. [00/01] -4.30-6.96%00.00%-0.02-0.12%-43417-0.45%