因为某种原因需要在服务器上测试Top500。
top500官网
Top500是一个对计算机性能进行排榜的榜单,而Green500则是一个对计算机能耗进行排榜的榜单,能耗=性能/功耗, Green500可以说是Top500的一个
Top500使用Linpack基准测试来测试服务器性能。
Linpack的C语言实现
HPL-用于分布式内存计算机的高性能LINPACK基准的便携式实现
单机测试
把Linpackc保存成clinpack.c文件。
编译
## 单精度测试
## cc -DSP -O4 -fsingle -fsingle2 clinpack.c -lm -DROLL
## cc -DSP -O4 -fsingle -fsingle2 clinpack.c -lm -DUNROLL
## cc -DSP -O4 clinpack.c -lm -DROLL
## cc -DSP -O4 clinpack.c -lm -DUNROLL
## 双精度测试
cc -DDP -O4 clinpack.c -lm -DROLL
cc -DDP -O4 clinpack.c -lm -DUNROLL
报错处理:
在ubuntu上使用gcc编译会出现以下错误。文件中要求的是Sun4下,不知道有没有影响
clinpack.c: In function ‘second’:
clinpack.c:899:6: error: conflicting types for ‘getrusage’
void getrusage();
^~~~~~~~~
In file included from clinpack.c:894:0:
/usr/include/x86_64-linux-gnu/sys/resource.h:87:12: note: previous declaration of ‘getrusage’ was here
extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __THROW;
^~~~~~~~~
getrusage和系统的函数重名了。但是并没有实现啊。猜测就是用系统的函数?这个函数好像是用来计时的。把这行注释掉。
一定要在编译的时候加上-DROLL或者-DUNROLL
cc -DSP -O4 -fsingle -fsingle2 clinpack.c -lm -DROLL
cc: error: unrecognized command line option ‘-fsingle’; did you mean ‘-fgimple’?
cc: error: unrecognized command line option ‘-fsingle2’; did you mean ‘-fgimple’?
单精度运行的时候会报错。直接删除-fsingle -fsingle2 即可。不知道会不会有影响。
运行
编译后形成可执行文件a.out
./a.out
结果
这个数据没什么意义。因为我们在运行的时候应该是要清空其他负载的。
Unrolled Single Precision Linpack
Unrolled Single Precision Linpack
norm. resid resid machep x[0]-1 x[n-1]-1
1.6 3.80277634e-05 1.19209290e-07 -1.38282776e-05 -7.51018524e-06
times are reported for matrices of order 100
dgefa dgesl total kflops unit ratio
times for array with leading dimension of 201
0.00 0.00 0.00 1335926 0.00 0.01
0.00 0.00 0.00 1362434 0.00 0.01
0.00 0.00 0.00 1381624 0.00 0.01
0.00 0.00 0.00 1411733 0.00 0.01
times for array with leading dimension of 200
0.00 0.00 0.00 1460992 0.00 0.01
0.00 0.00 0.00 1442577 0.00 0.01
0.00 0.00 0.00 1439552 0.00 0.01
0.00 0.00 0.00 2267723 0.00 0.01
Unrolled Single Precision 1411733 Kflops ; 10 Reps
Rolled Single Precision Linpack
Rolled Single Precision Linpack
norm. resid resid machep x[0]-1 x[n-1]-1
1.6 3.80277634e-05 1.19209290e-07 -1.38282776e-05 -7.51018524e-06
times are reported for matrices of order 100
dgefa dgesl total kflops unit ratio
times for array with leading dimension of 201
0.00 0.00 0.00 1226191 0.00 0.01
0.00 0.00 0.00 1269255 0.00 0.01
0.00 0.00 0.00 1328176 0.00 0.01
0.00 0.00 0.00 1847368 0.00 0.01
times for array with leading dimension of 200
0.00 0.00 0.00 3121202 0.00 0.00
0.00 0.00 0.00 3208733 0.00 0.00
0.00 0.00 0.00 3223788 0.00 0.00
0.00 0.00 0.00 3266731 0.00 0.00
Rolled Single Precision 1847368 Kflops ; 10 Reps
Unrolled Double Precision Linpack
Unrolled Double Precision Linpack
norm. resid resid machep x[0]-1 x[n-1]-1
1.7 7.41628980e-14 2.22044605e-16 -1.49880108e-14 -1.89848137e-14
times are reported for matrices of order 100
dgefa dgesl total kflops unit ratio
times for array with leading dimension of 201
0.00 0.00 0.00 920465 0.00 0.01
0.00 0.00 0.00 930443 0.00 0.01
0.00 0.00 0.00 930443 0.00 0.01
0.00 0.00 0.00 972065 0.00 0.01
times for array with leading dimension of 200
0.00 0.00 0.00 2043651 0.00 0.01
0.00 0.00 0.00 2043651 0.00 0.01
0.00 0.00 0.00 2043651 0.00 0.01
0.00 0.00 0.00 2326107 0.00 0.01
Unrolled Double Precision 972065 Kflops ; 10 Reps
Rolled Double Precision Linpack
Rolled Double Precision Linpack
norm. resid resid machep x[0]-1 x[n-1]-1
1.7 7.41628980e-14 2.22044605e-16 -1.49880108e-14 -1.89848137e-14
times are reported for matrices of order 100
dgefa dgesl total kflops unit ratio
times for array with leading dimension of 201
0.00 0.00 0.00 1125683 0.00 0.01
0.00 0.00 0.00 1173789 0.00 0.01
0.00 0.00 0.00 1211052 0.00 0.01
0.00 0.00 0.00 1215554 0.00 0.01
times for array with leading dimension of 200
0.00 0.00 0.00 1208920 0.00 0.01
0.00 0.00 0.00 1213192 0.00 0.01
0.00 0.00 0.00 1230585 0.00 0.01
0.00 0.00 0.00 2118034 0.00 0.01
Rolled Double Precision 1215554 Kflops ; 10 Reps
标签:Linpack,Top,0.01,Precision,笔记,times,clinpack,0.00,500
From: https://www.cnblogs.com/gamdwk/p/18047527