`
wusuoya
  • 浏览: 650194 次
  • 性别: Icon_minigender_2
  • 来自: 成都
社区版块
存档分类
最新评论

Linpack性能测试环境搭建

 
阅读更多

搭建好SSH无密码访问,NFS和NIS后可以搭建Linpack性能测试环境

云计算系统的一个重要作用是向用户提供计算力,评价一个系统的总体计算力的方 法就是采用一个统一的测试标准作为评判,现在评判一个系统计算力的方法中最为知名的就是Linpack测试,世界最快500台巨型机系统的排名采用的就是 这一标准。掌握Linpack测试技术对于在云计算时代评判一个云系统的计算力也有着重要意义。本附录将对Linpack测试技术作详细的介绍。(mpi,GotoBlas,Linpack都要安装在nfs共享目录下,或者所有节点都统一目录安装)

1.Linpack安装

在安装之前,我们需要做一些软件准备,相关的软件及下载地址如下。

(1)Linux平台,最新稳定内核的Linux发行版最佳,可以选择Red hat, Centos等。

(2)MPICH2,这是个并行计算的软件,可以到http://www.mcs.anl.gov/research/projects/mp ich2/downloads/index.php?s=downloads下载最新的源码包。

(3)Gotoblas,BLAS库(Basic Linear Algebra Subprograms)是执行向量和矩阵运算的子程序集合,这里我们选择公认性能最好的Gotoblas,最新版可到http://www.tacc.utexas.edu/tacc - projects/下载,需要注册。

(4)HPL,linpack测试的软件,可在http://www.netlib.org/benchmark/hpl/ 下载最新版本。

安装方法和步骤如下。

(1)安装MPICH2,并配置好环境变量,本书前面已作介绍。

(2)进入Linux系统,建议使用root用户,在/root下建立linpack文件夹,解压下载的Gotoblas和HPL文件到linpack文件夹下,改名为Gotoblas和hpl。

 

  1. #tar xvf GotoBLAS-*.tar.gz
  2. #mv GotoBLAS-*  ~/linpack/Gotoblas
  3. #tar xvf  hpl-*.tar.gz
  4. #mv hpl-*  ~/linpack/hpl

(3)安装Gotoblas。

进入Gotoblas文件夹,在终端下执行./ quickbuild.64bit(如果你是32位系统,则执行./ quickbuild.31bit)进行快速安装,当然,你也可以依据README里的介绍自定义安装。如果安装正常,在本目录下就会生成 libgoto2.a和libgoto2.so两个文件。

(4)安装HPL。

进入hpl文件夹从setup文件夹下提取与自己平台相近的Make.<arch>文件,复制到hpl文件夹内,比如我们的平台为 Intel xeon,所以就选择了Make.Linux_PII_FBLAS,它代表Linux操作系统、PII平台、采用FBLAS库。

编辑刚刚复制的文件,根据说明修改各个选项,使之符合自己的系统,比如我们系统的详细情况为,Intel xeon平台,mpich2安装目录为/usr/local/mipch2,hpl和gotoblas安装目录为/root/linpack,下面是我们 的配置文件Make.Linux_xeon,对需要修改的部分我们做了注解,大家可以参考修改:

  1. # - shell --------------------------------------------------------------
  2. # ----------------------------------------------------------------------
  3. #
  4. SHELL        = /bin/sh  
  5. #
  6. CD           = cd  
  7. CP           = cp  
  8. LN_S        = ln -s  
  9. MKDIR       = mkdir  
  10. RM          = /bin/rm -f  
  11. TOUCH       = touch  
  12. #
  13. # ----------------------------------------------------------------------
  14. # - Platform identifier ------------------------------------------------
  15. # ----------------------------------------------------------------------  
  16. #  
  17. ARCH         = Linux_xeon   //设置平台类型  
  18. #  
  19. # ----------------------------------------------------------------------  
  20. # - HPL Directory Structure / HPL library ------------------------------  
  21. # ----------------------------------------------------------------------  
  22. #  
  23. TOPdir       = $(HOME)/linpack/hpl   //设置测试软件的根目录  
  24. INCdir       = $(TOPdir)/include  
  25. BINdir       = $(TOPdir)/bin/$(ARCH)  
  26. LIBdir       = $(TOPdir)/lib/$(ARCH)  
  27. #  
  28. HPLlib       = $(LIBdir)/libhpl.a   
  29. #  
  30. # ----------------------------------------------------------------------  
  31. # - Message Passing library (MPI) --------------------------------------  
  32. # ----------------------------------------------------------------------  
  33. # MPinc tells the  C  compiler where to find the Message Passing library  
  34. # header files,  MPlib  is defined  to be the name of  the library to be  
  35. # used. The variable MPdir is only used for defining MPinc and MPlib.  
  36. #  
  37. MPdir        = /usr/local/mpich2     //设置mpich的安装目录  
  38. MPinc        = -I$(MPdir)/include  
  39. MPlib        = $(MPdir)/lib/libmpich.a  
  40. #  
  41. # ----------------------------------------------------------------------  
  42. # - Linear Algebra library (BLAS or VSIPL) -----------------------------  
  43. # ----------------------------------------------------------------------  
  44. # LAinc tells the  C  compiler where to find the Linear Algebra  library  
  45. # header files,  LAlib  is defined  to be the name of  the library to be  
  46. # used. The variable LAdir is only used for defining LAinc and LAlib.  
  47. #  
  48. LAdir        = $(HOME)/linpack/GotoBLAS2     //设置gotoblas的目录  
  49. LAinc        =  
  50. LAlib        = $(LAdir)/libgoto2.a $(LAdir)/libgoto2.so  //加入库支持  
  51. #  
  52. # ----------------------------------------------------------------------  
  53. # - F77 / C interface --------------------------------------------------  
  54. # ----------------------------------------------------------------------  
  55. # You can skip this section  if and only if  you are not planning to use  
  56. # a  BLAS  library featuring a Fortran 77 interface.  Otherwise,  it  is  
  57. # necessary  to  fill out the  F2CDEFS  variable  with  the  appropriate  
  58. # options.  **One and only one**  option should be chosen in **each** of  
  59. # the 3 following categories:  
  60. #  
  61. # 1) name space (How C calls a Fortran 77 routine)  
  62. #  
  63. # -DAdd_              : all lower case and a suffixed underscore  (Suns,  
  64. #                       Intel, ...),                           [default]  
  65. # -DNoChange          : all lower case (IBM RS6000),  
  66. # -DUpCase            : all upper case (Cray),  
  67. # -DAdd__             : the FORTRAN compiler in use is f2c.  
  68. #  
  69. # 2) C and Fortran 77 integer mapping  
  70. #  
  71. # -DF77_INTEGER=int   : Fortran 77 INTEGER is a C int,         [default]  
  72. # -DF77_INTEGER=long  : Fortran 77 INTEGER is a C long,  
  73. # -DF77_INTEGER=short : Fortran 77 INTEGER is a C short.  
  74. #  
  75. # 3) Fortran 77 string handling  
  76. #  
  77. # -DStringSunStyle    : The string address is passed at the string loca-  
  78. #                           tion on the stack, and the string length is then  
  79. #                           passed as  an  F77_INTEGER  after  all  explicit  
  80. #                           stack arguments,                       [default]  
  81. # -DStringStructPtr   : The address  of  a  structure  is  passed  by  a  
  82. #                           Fortran 77  string,  and the structure is of the  
  83. #                           form: struct {char *cp; F77_INTEGER len;},  
  84. # -DStringStructVal   : A structure is passed by value for each  Fortran  
  85. #                           77 string,  and  the  structure is  of the form:  
  86. #                           struct {char *cp; F77_INTEGER len;},  
  87. # -DStringCrayStyle   : Special option for  Cray  machines,  which  uses  
  88. #                           Cray  fcd  (fortran  character  descriptor)  for  
  89. #                           interoperation.  
  90. #  
  91. F2CDEFS      = -DAdd__ -DF77_INTEGER= int  -DStringSunStyle  
  92. #  
  93. # ----------------------------------------------------------------------  
  94. # - HPL includes / libraries / specifics -------------------------------  
  95. # ----------------------------------------------------------------------  
  96. #  
  97. HPL_INCLUDES = -I$(INCdir) -I$(INCdir)/$(ARCH) $(LAinc) $(MPinc)  
  98. HPL_LIBS     = $(HPLlib) $(LAlib) $(MPlib)  
  99. #  
  100. # - Compile time options -----------------------------------------------  
  101. #  
  102. # -DHPL_COPY_L           force the copy of the panel L before bcast;  
  103. # -DHPL_CALL_CBLAS       call the cblas interface;  
  104. # -DHPL_CALL_VSIPL       call the vsip  library;  
  105. # -DHPL_DETAILED_TIMING  enable detailed timers;  
  106. #  
  107. # By default HPL will:  
  108. #    *) not copy L before broadcast,  
  109. #    *) call the BLAS Fortran 77 interface,  
  110. #    *) not display detailed timing information.  
  111. #  
  112. HPL_OPTS     =  
  113. #  
  114. # ----------------------------------------------------------------------  
  115. #  
  116. HPL_DEFS     = $(F2CDEFS) $(HPL_OPTS) $(HPL_INCLUDES)  
  117. #  
  118. # ----------------------------------------------------------------------  
  119. # - Compilers / linkers - Optimization flags ---------------------------  
  120. # ----------------------------------------------------------------------  
  121. #  
  122. CC           = /usr/local/mpich2/bin/mpicc   //设置gcc编译器为mpicc  
  123. CCNOOPT      = $(HPL_DEFS)  
  124. CCFLAGS      = $(HPL_DEFS) -fomit-frame-pointer -O3 -funroll-loops -W -Wall  
  125. #  
  126. # On some platforms,  it is necessary  to use the Fortran linker to find  
  127. # the Fortran internals used in the BLAS library.  
  128. #  
  129. LINKER       = /usr/local/mpich2/bin/mpif77  //设置fortran编译器为mpif77  
  130. LINKFLAGS    = $(CCFLAGS)  
  131. #  
  132. ARCHIVER     = ar  
  133. ARFLAGS      = r  
  134. RANLIB       = echo  
  135. #  
  136. # -----------------------------/usr/local/mpich2/bin/mpicc---------------------

 

 

修改好文件以后,对其进行编译:

  1. #make arch=Linux_xeon

 

如果编译正常,在hpl/bin/Linux_xeon目录下就会生成两个文件HPL.dat和xhpl。 HPL.dat文件是Linpack测试的优化配置文件,这个对测试的结果十分重要,xhpl为可执行程序。

如果是集群测试,就将linpack目录复制到机群中其余节点相同的目录下。

至此,安装就算完成了。现在可以进行简单的测试.

进入hpl/bin/Linux_xeon目录,先启动mpd服务,在终端运行以下命令启动测试:

  1. #mpiexec -np 4 ./xhpl

 

 

 

 

当多台机器时,还可以加入节点配置文件,如machinefile,格式如下:

host1 :1   #Run 1 process on host1,host可以是域名或者是ip地址

host2:2    #Run 2 process on host2

............

 

需要注意的是:因为通信是双向的,所以需要在所有host上的/etc/hosts上都配置上

 

可运行命令如下:

#mpiexec -n 4 -f machinefile ./xhpl

 

运行结果如图

 

在最后一列中看到Gflops:4.937e-03

实际应该是cat /proc/cpuinfo

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           E5649  @ 2.53GHz
stepping        : 2
cpu MHz         : 2533.424
cache size      : 12288 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm arat
bogomips        : 5066.84
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           E5649  @ 2.53GHz
stepping        : 2
cpu MHz         : 2533.424
cache size      : 12288 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm arat
bogomips        : 5066.40
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual

 

双核,每核每个circle内可跑2个process(硬件决定),所以CPU完全利用时应该是2.53GHz*4=10.12

所以跑出的cpu只利用了不到50%

 

格式编排不好,原文可参看:

http://www.orientsky.com.cn/_new/Read.asp?ID=1495

http://www.orientsky.com.cn/_new/Read.asp?ID=1496

  • 大小: 62.3 KB
分享到:
评论

相关推荐

    linpack测试计算性能工具环境搭建及测试文档

    总结,搭建LINPACK测试环境需要综合理解计算性能测试的基本原理,掌握相关工具的安装和使用,以及优化策略。通过这个过程,不仅可以评估计算机的计算性能,还可以深入了解并行计算和数学库的运用,这对于任何涉及高...

    HPL_GPU.rar

    1. **环境搭建**: 在Linux环境下,你需要确保系统已安装CUDA(Compute Unified Device Architecture)驱动和开发工具包,这是GPU计算的基础。安装后,需要设置正确的环境变量,例如`PATH`、`LD_LIBRARY_PATH`等,...

    Linkpack测试1

    **环境搭建步骤** 在进行HPL测试前,需要建立一个适合并行计算的环境: 1. 在所有计算节点上安装Linux操作系统,确保操作系统稳定且支持并行计算。 2. 设置网络架构,保证节点间有高效率的通信速度,这对于并行...

    高新能集群的配置文档HPC

    整体来说,该文档为集群管理员提供了一套详尽的集群搭建与维护指南,涵盖了从集群操作系统安装、集群监控与管理到性能测试与优化的整个生命周期。集群管理员可以按照文档指导,快速搭建一个高性能的计算环境,不仅...

    Linux系统下的并行计算环境设计及应用举例

    3. **性能测试**:在并行环境搭建完成后,通常会使用Linpack测试来评估系统的浮点运算能力。Linpack是一组用于测量计算机性能的基准测试,尤其适合于并行计算环境。 4. **并行排序算法**:`rank_sort.c`和`Pipeline...

    MPI并行计算环境MPICH&HPL& GotoBLAS2,centos 7.3下安装

    最后,我们安装HPL,这是Linpack基准测试程序的高性能版本,用于评估计算机的浮点运算性能。HPL依赖于MPI环境和线性代数库,如GotoBLAS2。下载hpl-2.2.tar.gz,解压后,将Makefile配置文件复制并修改,以适应当前的...

    模电实验报告模板1

    本实验主要涉及的是在Linux环境下构建简单集群并进行性能测试。实验的关键技术点包括OpenMPI的安装与配置、高性能计算库HPL的使用以及SSH集群免密登录的配置。 1. **OpenMPI的安装**: - **前置环境**:在开始安装...

    构建一个工作集群

    此外,集群的构建还可以通过虚拟化技术,比如VMware,来实现,尽管在虚拟化环境下集群的性能会有所下降,但这种方式方便了用户在非物理硬件上进行集群系统的搭建与测试。 总之,构建一个工作集群是一个涉及多个技术...

    Linux集群组建和管理教学大纲.doc

    性能测试是Linux集群管理中不可或缺的一环。在第四章,学生将学习如何检查集群的网络连接和功能,如何使用各种性能评估工具如lamboot、一维数值积分并行程序、lamtests和linpack等进行测试。通过这些工具,学生能够...

Global site tag (gtag.js) - Google Analytics