• 天河超算,安装Hypre


    1)下载,解压

    得到目录:hypre-master

    源文件在src目录下面

    src包含如下目录:

     

     

    2)cmake编译

    版本比较新

    1. HYPRE_RELEASE_NAME = hypre
    2. HYPRE_RELEASE_VERSION = 2.26.0
    3. HYPRE_RELEASE_DATE = 2022/10/14
    4. HYPRE_RELEASE_TIME = 00:00:00
    5. HYPRE_RELEASE_BUGS = https://github.com/hypre-space/hypre/issues

    ./configure

    cd cmbuild

    cmake ..

    make

    生成了:

     6564172 Nov 28 11:30 libHYPRE.a
     

    3)编译例子

    cd hypre-master/src/test

    make会出错

    1. /thfs1/software/spack/optv018/linux-ubuntu20.04-aarch64/gcc-8.5.0/gcc-9.3.0-g3g7tub/bin/gcc -O2 -DHAVE_CONFIG_H -I. -I/thfs1/home/monkeycode/tianya/software/hypre-master/src/hypre/include -I/thfs1/software/mpich/mpi-n-gcc9.3.0/include -DHYPRE_TIMING -DHYPRE_FORTRAN -c zboxloop.c -o zboxloop.obj
    2. zboxloop.c:17:10: fatal error: _hypre_struct_mv.hpp: No such file or directory
    3. 17 | #include "_hypre_struct_mv.hpp"
    1. /thfs1/software/spack/optv018/linux-ubuntu20.04-aarch64/gcc-8.5.0/gcc-9.3.0-g3g7tub/bin/gcc -O2 -DHAVE_CONFIG_H -I. -I/thfs1/home/***/hypre-master/src/hypre/include -I/thfs1/software/mpich/mpi-n-gcc9.3.0/include -DHYPRE_TIMING -DHYPRE_FORTRAN -c sstruct.c
    2. In file included from sstruct.c:14:
    3. /thfs1/home/***/hypre-master/src/hypre/include/HYPRE_sstruct_ls.h:14:10: fatal error: HYPRE_sstruct_mv.h: No such file or directory
    4. 14 | #include "HYPRE_sstruct_mv.h"

    没有MPI头文件:

    1. /thfs1/home/***/software/hypre-master/src/hypre/include/HYPRE_utilities.h:20:10: fatal error: mpi.h: No such file or directory
    2. 20 | #include "mpi.h"
    3. | ^~~~~~~

    没有链接mpi库

    1. /thfs1/software/spack/optv018/linux-ubuntu20.04-aarch64/gcc-8.5.0/gcc-9.3.0-g3g7tub/bin/gcc -o ij ij.o -L/thfs1/home/***/hypre-master/src/hypre/lib -lHYPRE -Wl,-rpath,/thfs1/home/***/hypre-master/src/hypre/lib -lm
    2. /usr/bin/ld: /thfs1/home/***/hypre-master/src/hypre/lib/libHYPRE.a(mpistubs.c.o): in function `hypre_MPI_Init':
    3. mpistubs.c:(.text+0x8): undefined reference to `MPI_Init'
    4. /usr/bin/ld: /thfs1/home/***/hypre-master/src/hypre/lib/libHYPRE.a(mpistubs.c.o): in function `hypre_MPI_Finalize':
    5. mpistubs.c:(.text+0x10): undefined reference to `MPI_Finalize'
    1. pcg.c:(.text+0x8b4): undefined reference to `pow'
    2. /usr/bin/ld: pcg.c:(.text+0xc00): undefined reference to `sqrt'
    3. /usr/bin/ld: pcg.c:(.text+0xf28): undefined reference to `sqrt'
    4. /usr/bin/ld: pcg.c:(.text+0xf48): undefined reference to `sqrt'
    5. /usr/bin/ld: pcg.c:(.text+0xf58): undefined reference to `sqrt'

    还有sin, cos没有的

    解决方法:

    修改 config/Makefile.config

    1. 107 ##################################################################
    2. 108 ## MPI options
    3. 109 ##################################################################
    4. 110 MPIINCLUDE = -I/thfs1/software/mpich/mpi-n-gcc9.3.0/include
    5. 111 MPILIBDIRS = -I/thfs1/software/mpich/mpi-n-gcc9.3.0/lib
    6. 112 MPILIBS = -lmpi
    7. 113 MPIFLAGS =

    上面是mpi的头文件,库,及链接函数等

    加了-lm

    缺少Hypre本身的头文件,可能需要同样配置这个config/Makefile.config

    由于-I/thfs1/home/***/hypre-master/src/hypre/include 

    所以我是把所有的相差的.h, .hpp去cp到/thfs1/home/***/hypre-master/src/hypre/include 这个目录下。

    4)

    make

    生成了各种可执行文件

     

    运行./ij_mm

    输出 没有问题
     

    1. CPU #OMP THREADS 1
    2. Laplacian: num_fun = 1
    3. (nx, ny, nz) = (10, 10, 10)
    4. (Px, Py, Pz) = (1, 1, 1)
    5. (cx, cy, cz) = (1.000000, 1.000000, 1.000000)
    6. =============================================
    7. Generate Matrices:
    8. =============================================
    9. Generate Matrices:
    10. wall clock time = 0.000380 seconds
    11. wall MFLOPS = 0.000000
    12. cpu clock time = 0.000380 seconds
    13. cpu MFLOPS = 0.000000
    14. A 1000 x 1000, NNZ 6400, RNZ 6
    15. --- rep 0 (out of 10) ---
    16. --- rep 1 (out of 10) ---
    17. --- rep 2 (out of 10) ---
    18. --- rep 3 (out of 10) ---
    19. --- rep 4 (out of 10) ---
    20. --- rep 5 (out of 10) ---
    21. --- rep 6 (out of 10) ---
    22. --- rep 7 (out of 10) ---
    23. --- rep 8 (out of 10) ---
    24. --- rep 9 (out of 10) ---
    25. =============================================
    26. Device Parcsr Matrix-by-Matrix, A*A:
    27. =============================================
    28. Device Parcsr Matrix-by-Matrix, A*A:
    29. wall clock time = 0.000360 seconds
    30. wall MFLOPS = 0.000000
    31. cpu clock time = 0.000361 seconds
    32. cpu MFLOPS = 0.000000
    33. B 1000 x 1000, NNZ 20920, RNZ 20
    1. ./struct
    2. Using HYPRE_RELEASE_VERSION: 2.26.0
    3. Running with these driver parameters:
    4. (nx, ny, nz) = (10, 10, 10)
    5. (istart[0],istart[1],istart[2]) = (-3, -3, -3)
    6. (Px, Py, Pz) = (1, 1, 1)
    7. (bx, by, bz) = (1, 1, 1)
    8. (px, py, pz) = (0, 0, 0)
    9. (cx, cy, cz) = (1.000000, 1.000000, 1.000000)
    10. (conx,cony,conz)= (0.000000, 0.000000, 0.000000)
    11. (n_pre, n_post) = (1, 1)
    12. dim = 3
    13. skip = 0
    14. sym = 1
    15. rap = 0
    16. relax = 1
    17. jump = 0
    18. solver ID = 0
    19. =============================================
    20. Struct Interface:
    21. =============================================
    22. Struct Interface:
    23. wall clock time = 0.000384 seconds
    24. wall MFLOPS = 0.000000
    25. cpu clock time = 0.000385 seconds
    26. cpu MFLOPS = 0.000000
    27. =============================================
    28. Setup phase times:
    29. =============================================
    30. SMG Setup:
    31. wall clock time = 0.009755 seconds
    32. wall MFLOPS = 0.000000
    33. cpu clock time = 0.009758 seconds
    34. cpu MFLOPS = 0.000000
    35. =============================================
    36. Solve phase times:
    37. =============================================
    38. SMG Solve:
    39. wall clock time = 0.011196 seconds
    40. wall MFLOPS = 0.000000
    41. cpu clock time = 0.011011 seconds
    42. cpu MFLOPS = 0.000000
    43. Iterations = 5
    44. Final Relative Residual Norm = 1.375560e-07

    看起来没有问题。

  • 相关阅读:
    初尝pinia,相比于vuex轻量、好用
    【设计】OOA、OOD、OOP
    2023衡阳师范学院计算机考研信息汇总
    Global View的概念和实现|OneFlow学习笔记
    2023年9月青少年软件编程(C 语言) 等级考试试卷(一级)
    在 IDEA 中如何创建 SpringBoot 项目
    【SAP ME 26】SAP ME创建开发组件(DC)mobile
    正则表达式常用示例
    C语言程序设计笔记(浙大翁恺版) 第十三周:文件
    基于CentOS 7.9离线安装CM6.3.1和CDH6.3.2大数据平台
  • 原文地址:https://blog.csdn.net/anlongstar/article/details/128075908