关键字:SPEC CPU Int Float 测试程序 单独运行
下面以bzip2为例说明
1. 利用runspec
runspec --config=00.cfg --size=ref --tune=base --noreportable --iterations=3 bzip2
note:
00.cfg修改成你的配置文件名称,位于config目录下
2. 完全动手,彻底消除spec神秘感
先利用1中的方法运行bzip2,然后运行下面的命令:
ps -ef | grep bzip
可以看到真实的命令行和进程路径,提取出来,依样画葫芦即可。
对于bzip2,提取到的命令行类似如下:
run_base_test_cpu2006.0000/bzip2_base.cpu2006 input.combined 280
3. (2)中的方法还是要求用runspec执行一次应用。能不能像运行普通程序一样运行SPEC2006中的单个benchmark呢?
能! 以执行gcc下的benchmark为例:
# cd YOUR_SPEC_ROOT/benchspec/CPU2006/403.gcc/run/run_base_ref_cpu2006.0000
#specinvoke -n
... shows the command line that executes the benchmark
# 复制得到的命令行,像执行普通程序一样执行即可
[root@ga01 run_base_ref_cpu2006.0000]# specinvoke -n # Use another -n on the command line to see chdir commands # Starting run for copy #0 ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 166.i -o 166.s > 166.out 2>> 166.err # Starting run for copy #0 ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 200.i -o 200.s > 200.out 2>> 200.err # Starting run for copy #0 ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 c-typeck.i -o c-typeck.s > c-typeck.out 2>> c-typeck.err # Starting run for copy #0 ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 cp-decl.i -o cp-decl.s > cp-decl.out 2>> cp-decl.err # Starting run for copy #0 ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 expr.i -o expr.s > expr.out 2>> expr.err # Starting run for copy #0 ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 expr2.i -o expr2.s > expr2.out 2>> expr2.err # Starting run for copy #0 ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 g23.i -o g23.s > g23.out 2>> g23.err # Starting run for copy #0 ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 s04.i -o s04.s > s04.out 2>> s04.err # Starting run for copy #0 ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 scilab.i -o scilab.s > scilab.out 2>> scilab.err
而实际上,specinvoke只是解释了speccmds.cmd中的命令而已:
[root@ga01 run_base_ref_cpu2006.0000]# cat speccmds.cmd -C /root/SPECcpu2006/benchspec/CPU2006/403.gcc/run/run_base_ref_cpu2006.0000 -o 166.out -e 166.err ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 166.i -o 166.s -o 200.out -e 200.err ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 200.i -o 200.s -o c-typeck.out -e c-typeck.err ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 c-typeck.i -o c-typeck.s -o cp-decl.out -e cp-decl.err ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 cp-decl.i -o cp-decl.s -o expr.out -e expr.err ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 expr.i -o expr.s -o expr2.out -e expr2.err ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 expr2.i -o expr2.s -o g23.out -e g23.err ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 g23.i -o g23.s -o s04.out -e s04.err ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 s04.i -o s04.s -o scilab.out -e scilab.err ../run_base_ref_cpu2006.0000/gcc_base.cpu2006 scilab.i -o scilab.s
附录:
关于spec的评分制度:
整形和浮点性能测试结果分别如下图表3和表4所示。其中Reference Time表示参考时间,Base Runtime表示实际运行时间,Base Ratio表示比值。其综合得分为206和168分,是各项基准程序得分的几何平均值 ,计算公式如下:
SPEC_mark=GEOMEAN(Reference_Time/Base_Runtime * 100)
参考文献:
http://61ic.com/Technology/embed/201011/28136.html
http://www.spec.org/cpu2006/Docs/runspec-avoidance.html