ROSE 編譯器框架/SPEC CPU 2006 基準測試
假設原始碼包位於 /usr/casc/overture/ROSE/svn/spec_cpu2006_v1.1 下
./install.sh -d /home/yourAccount/opt/spec_cpu2006
/home/yourAccount/opt/spec_cpu2006/benchspec/CPU2006/400.perlbench 子目錄
- build data Docs exe run Spec src
12+17= 29 個基準測試
12 個整數基準測試:http://www.spec.org/cpu2006/CINT2006/
- 400.perlbench C 程式語言
- 源自 Perl V5.8.7。工作負載包括 SpamAssassin、MHonArc(電子郵件索引器)和 specdiff(SPEC 用於檢查基準測試輸出的工具)。
$ cloc-1.56.pl 400.perlbench
3057 text files.
1517 unique files.
484 files ignored.
http://cloc.sourceforge.net v 1.56 T=57.0 s (23.8 files/s, 26844.6 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Perl 1179 127322 661995 451954
C 109 13768 31736 192811
C/C++ Header 65 4202 9296 30785
XML 1 680 13 5357
Pascal 1 9 115 78
make 2 4 1 14
-------------------------------------------------------------------------------
SUM: 1357 145985 703156 680999
-------------------------------------------------------------------------------
- 401.bzip2 C 壓縮
- Julian Seward 的 bzip2 版本 1.0.3,修改為在記憶體中執行大部分工作,而不是執行 I/O。
$ cloc-1.56.pl 401.bzip2/
56 text files.
43 unique files.
27 files ignored.
http://cloc.sourceforge.net v 1.56 T=1.0 s (17.0 files/s, 12473.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 10 1083 1131 5561
HTML 1 639 5 2837
C/C++ Header 3 210 174 617
XML 1 36 6 137
Perl 1 5 0 25
make 1 1 1 5
-------------------------------------------------------------------------------
SUM: 17 1974 1317 9182
-------------------------------------------------------------------------------
- 403.gcc C C 編譯器
- 基於 gcc 版本 3.2,為 Opteron 生成程式碼。
$ cloc 403.gcc/
-bash: cloc: command not found
[hudson-rose@hudson-rose-30]cloc-1.56.pl 403.gcc/
597 text files.
319 unique files.
26 files ignored.
http://cloc.sourceforge.net v 1.56 T=40.0 s (7.4 files/s, 46660.2 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Assembly 11 0 2794 1331673
C 159 58475 62060 370172
C/C++ Header 110 5890 9295 17385
XML 1 1242 6 3794
Teamcenter def 12 611 47 2897
Perl 1 4 0 55
make 1 1 1 5
-------------------------------------------------------------------------------
SUM: 295 66223 74203 1725981
-------------------------------------------------------------------------------
- 429.mcf C 組合最佳化
- 車輛排程。使用網路單純形演算法(也用於商業產品)來排程公共交通。
$ cloc-1.56.pl 429.mcf/
94 text files.
64 unique files.
37 files ignored.
http://cloc.sourceforge.net v 1.56 T=2.0 s (19.5 files/s, 2090.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 22 526 345 2501
C/C++ Header 14 221 216 204
XML 1 24 10 95
Perl 1 5 0 26
make 1 1 1 5
-------------------------------------------------------------------------------
SUM: 39 777 572 2831
-------------------------------------------------------------------------------
- 445.gobmk C 人工智慧:圍棋
- 玩圍棋遊戲,一種簡單描述但極其複雜的棋盤遊戲。
$ cloc-1.56.pl 445.gobmk/
3110 text files.
1543 unique files.
2767 files ignored.
http://cloc.sourceforge.net v 1.56 T=37.0 s (4.3 files/s, 7464.7 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 134 25940 25404 218416
C/C++ Header 22 1048 1595 3478
XML 1 49 6 139
Perl 1 7 11 95
make 1 1 1 5
-------------------------------------------------------------------------------
SUM: 159 27045 27017 222133
-------------------------------------------------------------------------------
- 456.hmmer C 搜尋基因序列
- 使用 profile 隱馬爾可夫模型 (profile HMMs) 進行蛋白質序列分析
$ cloc-1.56.pl 456.hmmer/
235 text files.
160 unique files.
37 files ignored.
http://cloc.sourceforge.net v 1.56 T=4.0 s (33.0 files/s, 17054.2 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 114 3946 22853 38230
C/C++ Header 15 324 1045 1413
XML 1 75 6 212
Perl 1 4 0 102
make 1 1 1 5
-------------------------------------------------------------------------------
SUM: 132 4350 23905 39962
-------------------------------------------------------------------------------
- 458.sjeng C 人工智慧:國際象棋
- 一個排名很高的國際象棋程式,也可以玩幾種國際象棋變體。
$ cloc-1.56.pl 458.sjeng/
69 text files.
45 unique files.
18 files ignored.
http://cloc.sourceforge.net v 1.56 T=2.0 s (14.0 files/s, 7162.5 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 21 2152 1068 10429
C/C++ Header 4 123 36 397
XML 1 17 6 56
Perl 1 6 0 28
make 1 1 1 5
-------------------------------------------------------------------------------
SUM: 28 2299 1111 10915
-------------------------------------------------------------------------------
- 462.libquantum C 物理學 / 量子計算
- 模擬量子計算機,執行 Shor 的多項式時間因式分解演算法。
$ cloc-1.56.pl 462.libquantum/
86 text files.
54 unique files.
19 files ignored.
http://cloc.sourceforge.net v 1.56 T=1.0 s (36.0 files/s, 4694.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 18 798 492 2302
C/C++ Header 15 267 243 394
XML 1 40 6 111
Perl 1 7 0 27
make 1 1 1 5
-------------------------------------------------------------------------------
SUM: 36 1113 742 2839
-------------------------------------------------------------------------------
- 464.h264ref C 影片壓縮
- H.264/AVC 的參考實現,使用 2 個引數集對影片流進行編碼。預計 H.264/AVC 標準將取代 MPEG2
$ cloc-1.56.pl 464.h264ref/
191 text files.
109 unique files.
23 files ignored.
http://cloc.sourceforge.net v 1.56 T=3.0 s (28.7 files/s, 17554.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 44 5968 7718 33063
C/C++ Header 39 899 1118 3409
XML 1 71 6 321
Perl 1 6 0 76
make 1 1 1 5
-------------------------------------------------------------------------------
SUM: 86 6945 8843 36874
-------------------------------------------------------------------------------
- 471.omnetpp C++ 離散事件模擬
- 使用 OMNet++ 離散事件模擬器對大型乙太網校園網路進行建模。
$ cloc-1.56.pl 471.omnetpp/
333 text files.
178 unique files.
22 files ignored.
http://cloc.sourceforge.net v 1.56 T=4.0 s (39.2 files/s, 12109.5 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C++ 85 5087 3697 22603
C/C++ Header 69 2684 9788 4044
XML 1 122 6 357
Perl 1 4 0 39
make 1 1 1 5
-------------------------------------------------------------------------------
SUM: 157 7898 13492 27048
-------------------------------------------------------------------------------
- 473.astar C++ 路徑查詢演算法
- 用於 2D 地圖的路徑查詢庫,包括著名的 A* 演算法。
$ cloc-1.56.pl 473.astar/
107 text files.
64 unique files.
42 files ignored.
http://cloc.sourceforge.net v 1.56 T=1.0 s (33.0 files/s, 9131.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C++ 22 949 192 5972
C/C++ Header 8 544 62 1277
XML 1 22 6 56
Perl 1 9 0 35
make 1 1 1 5
-------------------------------------------------------------------------------
SUM: 33 1525 261 7345
-------------------------------------------------------------------------------
- 483.xalancbmk C++ XML 處理
- Xalan-C++ 的修改版本,將 XML 文件轉換為其他文件型別。
$ cloc-1.56.pl 483.xalancbmk/
3665 text files.
1820 unique files.
19 files ignored.
http://cloc.sourceforge.net v 1.56 T=75.0 s (24.0 files/s, 37920.6 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
XML 4 194172 8 2074361
C++ 829 54318 72591 202976
C/C++ Header 944 35917 120959 80316
C 19 811 2399 2982
XSD 2 86 0 789
Perl 1 16 14 767
XSLT 2 58 0 500
make 1 1 1 5
-------------------------------------------------------------------------------
SUM: 1802 285379 195972 2362696
-------------------------------------------------------------------------------
17 個浮點基準測試:http://www.spec.org/cpu2006/CFP2006/
- 410.bwaves Fortran 流體動力學 計算 3D 跨音速瞬態層流粘性流。
- 416.gamess Fortran 量子化學。Gamess 實現了一系列量子化學計算。對於 SPEC 工作負載,使用限制性 Hartree Fock 方法、限制性開殼 Hartree-Fock 和多配置自洽場進行自洽場計算
- 433.milc C 物理學 / 量子色動力學 用於具有動力學夸克的晶格規範理論程式的規範場生成程式。
- 434.zeusmp Fortran 物理學 / CFD ZEUS-MP 是在伊利諾伊大學厄巴納-香檳分校的國家超級計算應用中心 (NCSA) 開發的一種計算流體動力學程式碼,用於模擬天體物理現象。
- 435.gromacs C,
Fortran 生物化學 / 分子動力學 分子動力學,即模擬數百到數百萬個粒子的牛頓運動方程。測試用例模擬了溶液中的溶菌酶蛋白質。
- 436.cactusADM C,
Fortran 物理學 / 一般相對論 使用交錯跳躍數值方法求解愛因斯坦演化方程
- 437.leslie3d Fortran 流體動力學 使用 3D 線性渦流模型進行大渦模擬 (LES) 的計算流體動力學 (CFD)。使用 MacCormack 預測-校正時間積分方案。
- 444.namd C++ 生物學 / 分子動力學 模擬大型生物分子系統。測試用例包含 92,224 個載脂蛋白 A-I 原子。
- 447.dealII C++ 有限元分析 deal.II 是一個面向自適應有限元和誤差估計的 C++ 程式庫。測試用例求解具有非恆定係數的亥姆霍茲型方程。
- 450.soplex C++ 線性規劃,最佳化 使用單純形演算法和稀疏線性代數求解線性規劃。測試用例包括鐵路規劃和軍事空運模型。
- 453.povray C++ 影像光線追蹤 影像渲染。測試用例是使用 Perlin 噪聲函式對包含一些帶有紋理的抽象物體的景觀進行 1280x1024 反鋸齒渲染的影像。
- 454.calculix C,
Fortran 結構力學 用於線性和平面 3D 結構應用的有限元程式碼。使用 SPOOLES 求解器庫。
- 459.GemsFDTD Fortran 計算電磁學 使用有限差分時域 (FDTD) 方法在 3D 中求解麥克斯韋方程。
- 465.tonto Fortran 量子化學 一個開源量子化學包,在 Fortran 95 中使用面向物件設計。測試用例對分子 Hartree-Fock 波函式計算施加約束,以更好地匹配實驗 X 射線衍射資料。
- 470.lbm C 流體動力學 實現“格子玻爾茲曼方法”來模擬 3D 中不可壓縮的流體
- 481.wrf C,
Fortran 天氣 從米級到數千公里級的尺度進行天氣建模。測試用例來自 30 公里區域持續 2 天的資料。
- 482.sphinx3 C 語音識別 來自卡內基梅隆大學的一種廣為人知的語音識別系統
C : 14 個基準測試/ 12 個真正的基準測試,不包括 specrand
400.perlbench Programming Language 401.bzip2 Compression 403.gcc C Compiler 429.mcf Combinatorial Optimization 433.milc Physics / Quantum Chromodynamics 445.gobmk Artificial Intelligence: Go 456.hmmer Search Gene Sequence 458.sjeng Artificial Intelligence: chess 462.libquantum Physics / Quantum Computing 464.h264ref Video Compression 470.lbm Fluid Dynamics 482.sphinx3 Speech recognition 998.specrand 999.specrand
C++: 7 個基準測試 : namd dealII soplex povray omnetpp astar xalancbmk
444.namd 447.dealII 450.soplex 453.povray 471.omnetpp 473.astar 483.xalancbmk
Fortran: 6 個基準測試:bwaves gamess zeusmp leslie3d GemsFDTD tonto
410.bwaves 416.gamess 434.zeusmp 437.leslie3d 459.GemsFDTD 465.tonto
混合 C 和 Fortran:4 個:gromacs cactusADM calculix wrf
435.gromacs 436.cactusADM 454.calculix 481.wrf
- 環境 來源 /home/youAccount/opt/spec_cpu2006 中的 shrc 或 cshrc 以設定基準測試的環境。
. ./shrc
- 配置 準備 config/tux268-gcc42.cfg 基於現有的示例設定編譯器和標誌
表格摘要
- output_format = asc, pdf, Screen, html
http://www.spec.org/cpu2006/Docs/runspec.html#section3.1actions
- 僅構建
bash-3.00$ which runspec /home/youAccount/opt/spec_cpu2006/bin/runspec bash-3.00$ runspec --config=tux268-gcc42.cfg --action=build --tune=base bzip2
首先清理
- runspec --config=rose-linux64-gcc41 --tune=base --size=test --iterations=1 --noreportable --action=clobber all
- 使用測試資料集執行 預設是 --size=ref : 使用參考資料集執行
runspec --config=tux268-gcc42.cfg --tune=base --size=test --iterations=1 --noreportable bzip2 runspec --config=tux268-rose-gcc42.cfg --tune=base --size=test --iterations=1 --noreportable bzip2
- 執行所有整數或浮點基準測試 共 12 個整數基準測試
runspec --config=tux268-gcc42.cfg --tune=base --size=test --iterations=1 --noreportable int // total 12 400.perlbench -- 3.78 -- S 401.bzip2 -- 7.52 -- S 403.gcc -- 1.42 -- S 429.mcf -- 5.37 -- S 445.gobmk -- 20.0 -- S 456.hmmer -- 5.35 -- S 458.sjeng -- 5.00 -- S 462.libquantum -- 0.0951 -- S 464.h264ref -- 21.7 -- S 471.omnetpp -- 0.545 -- S 473.astar -- 10.7 -- S 483.xalancbmk -- 0.115 -- S Est. SPECint_base2006 -- Est. SPECint2006 Not Run runspec --config=tux268-gcc42.cfg --tune=base --size=test --iterations=1 --noreportable fp // total 17 410.bwaves -- 12.4 -- S 416.gamess -- 0.510 -- S 433.milc -- 8.71 -- S 434.zeusmp -- 25.2 -- S 435.gromacs -- 1.74 -- S 436.cactusADM -- 4.66 -- S 437.leslie3d -- 32.7 -- S 444.namd -- 15.6 -- S 447.dealII -- 22.6 -- S 450.soplex -- 0.0263 -- S 453.povray -- 0.874 -- S 454.calculix -- 0.0546 -- S 459.GemsFDTD -- 4.52 -- S 465.tonto -- 1.35 -- S 470.lbm -- 13.6 -- S 481.wrf -- 5.66 -- S 482.sphinx3 -- 2.26 -- S Est. SPECfp_base2006 -- Est. SPECfp2006 Not Run
首先測試 gcc/g++/gfortran,然後僅構建
清理:--action=clean 或 clobber 然後 identityTranslator
runspec --config=tux268-rose-gcc42.cfg --tune=base --size=test --iterations=1 --noreportable gobmk
可報告的執行確保您的二進位制檔案可以使用測試和訓練工作負載生成正確的結果(此執行規則要求是 CPU2006 V1.0 之後的新要求),然後針對實際測量執行 ref 工作負載 3 次。
runspec --config=tux268-rose-gcc42.cfg --tune=base --size=ref --iterations=1 --noreportable perlbench
資料大小
- test:最小的資料集
- train:測試在單個呼叫中執行多個大小的能力
- ref(預設):執行 3 次以獲取可報告的結果
runspec --action=clobber int fp runspec --config=tux268-intel.cfg --tune=base --size=test --iterations=1 --noreportable bzip2 runspec --config=tux268-rose-gcc42.cfg --tune=base --size=test --iterations=1 --noreportable bzip2 runspec --config=tux268-rose-gcc42.cfg --tune=base --size=test --iterations=1 --noreportable bzip2 bash-3.00$ pwd /home/yourAccount/opt/spec_cpu2006 bash-3.00$ runspec --config=tux268-rose-gcc42.cfg --tune=base --size=test --iterations=1 --noreportable fp
更改 /home/yourAccount/opt/spec_cpu2006/benchspec/CPU2006/400.perlbench/src/spec_config.h
新增 #include <stdbool.h>
必須在配置檔案(例如 config/tux268-rose-gcc42.cfg)中新增一行以避免損壞的原始碼警告
strict_rundir_verify = 0
pwd
/home/yourAccount/opt/spec_cpu2006/benchspec/CPU2006/400.perlbench/src
/home/yourAccount/opt/roseLatest/bin/identityTranslator -c -o sv.o -DSPEC_CPU -DNDEBUG -DPERL_CORE -O2 -DSPEC_CPU_LINUX_IA32 sv.c Adding argv[3] = sv.o to p_objectFileNameList Using strcmp(): This was not a valid string (buffer = define returned) Using strcmp(): This was not a valid string (buffer = define returned) Error: Unknown cppIndentifier = identityTranslator: ../../../../rose/src/frontend/SageIII/rose_attributes_list.C:1676: bool ROSEAttributesList::isCppDirective(const std::string&, PreprocessingInfo::DirectiveType&, std::string&): Assertion `false' failed. Aborted
/home/yourAccount/opt/spec_cpu2006/benchspec/CPU2006/401.bzip2/run/run_base_test_i386-m32-gcc42-nn.0001
- .mis
bash-3.00$ cat dryer.jpg.out.mis
0008: Compressed data 1434910 bytes in length
Compressed data 1434894 bytes in length
^
0013: Compressed data 1127895 bytes in length
Compressed data 1127995 bytes in length
^
0018: Compressed data 1067335 bytes in length
Compressed data 1067427 bytes in length
^
每個基準測試都有一個命令列檔案
run_base_test_amd64-m64-gcc41-nn.0000/speccmds.cmd
sphinx_livepretend_base.amd64-m64-gcc41-nn ctlfile . args.an4
403.gcc ~/opt/spec_cpu2006/benchspec/CPU2006/403.gcc/run/run_base_test_amd64-m64-gcc41-nn.0000]
[yourAccount@tux322]cat speccmds.cmd -C /home/yourAccount/opt/spec_cpu2006/benchspec/CPU2006/403.gcc/run/run_base_test_amd64-m64-gcc41-nn.0000 -o cccp.out -e cccp.err ../run_base_test_amd64-m64-gcc41-nn.0000/gcc_base.amd64-m64-gcc41-nn cccp.i -o cccp.s # ignore -C etc. focus on the final part! gdb -args ../run_base_test_amd64-m64-gcc41-nn.0000/gcc_base.amd64-m64-gcc41-nn cccp.i -o cccp.s
我們使用 ROSE 的 identityTranslator。與任何其他基於 ROSE 的翻譯器一樣,它旨在自動檢測輸入原始檔型別並呼叫正確的 EDG 功能。
我們確實在 SPEC CPU2006 的子集上測試了 ROSE,作為我們日常回歸測試的一部分。ROSE 可以完全支援 12 個 SPEC C 基準測試中的 10 個(編譯它們並擁有經過驗證的執行結果)。10 個 C 基準測試是 perlbench、bzip2、mcf、milc、gobmk、hmmer、sjeng、libquantum、lbm 和 sphinx3。gcc 和 h264ref 有一些小問題(主要與 ROSE 處理宏呼叫的方式有關),但我們正在努力解決這個問題。
我們使用 ROSE 編譯 SPEC 的方式是:1) 將 ROSE 安裝(透過 make install)到某個目錄,例如 ROSE_INS(透過 configure --prefix=ROSE_INS 指定)。
2) 設定使用已安裝 ROSE 的環境,identityTranslator 位於 ROSE_INS/bin 下 PATH=$ROSE_INS/bin:$PATH LD_LIBRARY_PATH=$ROSE_INS/lib:$LD_LIBRARY_PATH export PATH LD_LIBRARY_PATH
3) 準備一個 SPEC 配置檔案(例如 spec_installation_path/config/rose.cfg)以使用 ROSE。rose.cfg 中的一組相關選項是
#We want to the test to abort on errors and report immediately ignore_errors = no # we want have ascii and table-based output (Screen) for results output_format = asc, Screen #The result is not intended for official reports to the SPEC organization reportable = 0 # compilers to compile benchmarks CC = identityTranslator CXX = identityTranslator FC = identityTranslator # compilation options: turn off ROSE ’s EDG frontend warnings # since we are not interesting in fixing the benchmarks COPTIMIZE = -O2 --edg:no_warnings CXXOPTIMIZE = -O2 --edg:no_warnings FOPTIMIZE = -O2 --edg:no_warnings
4) 最後,您可以在 SPEC 上測試 ROSE
cd $SPEC_CPU2006_INS # set up environment to run spec . ./shrc # clean up previous object/executable files for all floating point and integer benchmarks runspec --config=rose.cfg --tune=base --size=test --iterations=1 --noreportable fp int --action=clobber runspec --config=$SPEC_CPU2006_CONFIG --tune=base --size=test --iterations=1 --noreportable \ perlbench bzip2 mcf milc gobmk hmmer sjeng libquantum lbm sphinx3
現在已透過 10/12 個
透過集:runspec --config=tux268-rose-gcc42.cfg --tune=base --size=test --iterations=1 --noreportable perlbench bzip2 mcf milc gobmk hmmer sjeng libquantum lbm sphinx3
perlbench: pass !!! compilation -D_GNUG__ problem bool problem
bzip2: pass !!! line continuation for two empty line problem: compilation but wrong results
gcc : noncompilable rose_x pending on a bug 347?, Unparse_ExprStmt::unparseEnumDeclStmt() SgInitializedName should be moved to located node
test case test2009_05.c
mcf : pass!!!
milc: pass!!!
gobmk : pass!!! file path issue include/liberty.h vs. engine/liberty.h rose_out.c engine/rose_out.c
hmmer : pass!!! EDG frontend failure: implicit C function decl
sjeng : pass!!!
libquantum:pass!!!
h264ref: noncompilable rose_x recursive macro replace after macro expansion:
lbm : pass!!!
sphinx3: pass!!! __FILE__ macro expansion problem. file name vs. full path+filename
runspec --config=tux268-rose-gcc42.cfg --tune=base --size=test --iterations=1 --noreportable sphinx3
/home/yourAccount/opt/spec_cpu2006/bin/specinvoke -d /home/yourAccount/opt/spec_cpu2006/benchspec/CPU2006/482.sp hinx3/run/run_base_test_i386-m32-gcc42-nn.0000 -e speccmds.err -o speccmds.stdout -f speccmds.cmd -C
/home/yourAccount/opt/spec_cpu2006/bin/specinvoke -E -d /home/yourAccount/opt/spec_cpu2006/benchspec/CPU2006/482 .sphinx3/run/run_base_test_i386-m32-gcc42-nn.0000 -c 1 -e compare.err -o compare.stdout -f compare.c md
*** Miscompare of an4.log; for details see
/home/yourAccount/opt/spec_cpu2006/benchspec/CPU2006/482.sphinx3/run/run_base_test_i386-m32-gcc42-nn.0 000/an4.log.mis
Error: 1x482.sphinx3
runspec --config=tux268-rose-gcc42.cfg --tune=base --size=test --iterations=1 --noreportable namd dealII soplex povray omnetpp astar xalancbmk
- Henning, J.L., SPEC CPU2000 測量新千年的 CPU 效能,2000
- http://www.spec.org/cpu2006/