Linux下Linpack测试CPU性能的相关参数配置以及执行命令

一、参数解释

合适的HPL.dat参数设置才能够正常运行以及达到较好的性能。

HPLinpack benchmark input file
Innovative Computing Laboratory, University of Tennessee
HPL.out      output file name (if any)
8            device out (6=stdout,7=stderr,file)
1            # of problems sizes (N)
80000       Ns
1            # of NBs
1024         NBs
0            PMAP process mapping (0=Row-,1=Column-major)
1           # of process grids (P x Q)
1           Ps
1           Qs
16.0         threshold
1            # of panel fact
1        PFACTs (0=left, 1=Crout, 2=Right)
1            # of recursive stopping criterium
4          NBMINs (>= 1)
1            # of panels in recursion
2            NDIVs
1            # of recursive panel fact.
1        RFACTs (0=left, 1=Crout, 2=Right)
1            # of broadcast
0            BCASTs (0=1rg,1=1rM,2=2rg,3=2rM,4=Lng,5=LnM)
1            # of lookahead depth
2            DEPTHs (>=0)
2            SWAP (0=bin-exch,1=long,2=mix)
64           swapping threshold
0            L1 in (0=transposed,1=no-transposed) form
0            U  in (0=transposed,1=no-transposed) form
1            Equilibration (0=no,1=yes)
8            memory alignment in double (> 0)

1、第1、2行为注释说明行,不需要作修改

2、第3行说明如果输出文件的话,文件的名字

3、第4行说明输出结果文件的形式,为“6”时,测试结果输出至标准输出(stdout),为“7”时,测试结果输出至标准错误输出(stderr),为其它值时,测试结果输出至第3行所指定的文件中

4、第5行说明求解问题(矩阵)的个数,也就是第6行要设置的参数的个数

5、第6行要设置矩阵的阶,参数值要与第5行的数值相等。网上大多数都说N的值为N×N×8=系统总内存×80%最优

6、第7行说明求解问题(矩阵)时采用的分块方式的种数,也就是第8行要设置的参数的个数

7、第8行说明每一种分块的大小。为提高数据的局部性,从而提高整体性能,HPL采用分块矩阵的算法。NB值的选择主要是通过实际测试得到最优值。

8、第9行是选择处理器阵列是按列的排列方式还是按行的排列方式。

9、第10-12行说明二维处理器网格(P×Q)。二维处理器网格(P×Q)的要遵循以下几个要求:P×Q=进程数。这是HPL的硬性规定。

10、其他值采取默认即可。

二、单个节点上执行

命令:

./xhpl

结果:

================================================================================
HPLinpack 2.3  --  High-Performance Linpack benchmark  --   December 2, 2018
Written by A. Petitet and R. Clint Whaley,  Innovative Computing Laboratory, UTK
Modified by Piotr Luszczek, Innovative Computing Laboratory, UTK
Modified by Julien Langou, University of Colorado Denver
================================================================================

An explanation of the input/output parameters follows:
T/V    : Wall time / encoded variant.
N      : The order of the coefficient matrix A.
NB     : The partitioning blocking factor.
P      : The number of process rows.
Q      : The number of process columns.
Time   : Time in seconds to solve the linear system.
Gflops : Rate of execution for solving the linear system.

The following parameter values will be used:

N      :   80000 
NB     :    1024 
PMAP   : Row-major process mapping
P      :       1 
Q      :       1 
PFACT  :   Crout 
NBMIN  :       4 
NDIV   :       2 
RFACT  :   Crout 
BCAST  :   1ring 
DEPTH  :       2 
SWAP   : Mix (threshold = 64)
L1     : transposed form
U      : transposed form
EQUIL  : yes
ALIGN  : 8 double precision words

--------------------------------------------------------------------------------

- The matrix A is randomly generated for each test.
- The following scaled residual check will be computed:
      ||Ax-b||_oo / ( eps * ( || x ||_oo * || A ||_oo + || b ||_oo ) * N )
- The relative machine precision (eps) is taken to be               1.110223e-16
- Computational tests pass if scaled residuals are less than                16.0

================================================================================
T/V                N    NB     P     Q               Time                 Gflops
--------------------------------------------------------------------------------
WR20C2C4       80000  1024     1     1             729.77             4.6774e+02
HPL_pdgesv() start time Fri Jul 17 09:24:43 2020

HPL_pdgesv() end time   Fri Jul 17 09:36:53 2020

--------------------------------------------------------------------------------
||Ax-b||_oo/(eps*(||A||_oo*||x||_oo+||b||_oo)*N)=   2.16389188e-03 ...... PASSED
================================================================================

Finished      1 tests with the following results:
              1 tests completed and passed residual checks,
              0 tests completed and failed residual checks,
              0 tests skipped because of illegal input values.
--------------------------------------------------------------------------------

End of Tests.
================================================================================

三、多个节点执行

命令:

第一种方式:
mpirun -np N xhpl  N为进程数


第二种方式:
mpirun -p4pg <p4file> xhpl  需要自己编写配置文件,p4file指定每个进程在哪个节点运行

 

  • 2
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 10
    评论
Linux下进行Linpack测试CPU性能的关键参数配置包括: 1. 线程数(Number of Threads):决定Linpack测试中使用的并行线程数量。可以根据CPU核心数目和线程数进行调整,一般建议将线程数设置为和CPU核心数目相同或略小的数量。 2. 问题规模(Problem Size):表示Linpack测试中计算矩阵的尺寸。可以通过调整问题规模来测试不同程度的CPU负载。通常使用N、NB、P三个参数来定义问题规模。 - N(尺寸):指定矩阵的大小,决定了问题规模的大致范围。 - NB(分块尺寸):指定矩阵的分块尺寸,用于提高缓存效率,通常设置为16或32。 - P(进程数量):指定进行计算的进程数目,通常设置为1。 3. 精度(Precision):指定Linpack测试中所使用的浮点数精度,可以选择单精度(single)或双精度(double)。 4. 线程绑定(Thread Binding):可选择是否对Linpack测试中的线程进行绑定到特定的CPU核心,以避免线程的切换带来的性能损失。 执行Linpack测试的命令为: ``` ./xlinpack_xeon64 -D N -s NB -p Precision -t Number_of_Threads -b ``` 其中,xlinpack_xeon64为Linpack测试的可执行文件名,N为问题规模中的尺寸参数,NB为分块尺寸参数,Precision为精度参数,Number_of_Threads为线程数参数,-b选项用于开启线程绑定。 例如,若希望进行一个尺寸为5000、分块尺寸为32的双精度测试,并使用8个线程进行计算,并开启线程绑定,命令如下: ``` ./xlinpack_xeon64 -D 5000 -s 32 -p double -t 8 -b ``` 执行该命令后,Linpack测试将会以指定的参数进行计算,并输出测试结果,包括计算速度(MFLOPS),以及矩阵校验结果。根据测试结果可以评估CPU性能表现。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值