天河超算,安装Hypre

3 篇文章 0 订阅

1)下载,解压

得到目录:hypre-master

源文件在src目录下面

src包含如下目录:

 

 

2)cmake编译

版本比较新

HYPRE_RELEASE_NAME    = hypre
HYPRE_RELEASE_VERSION = 2.26.0
HYPRE_RELEASE_DATE    = 2022/10/14
HYPRE_RELEASE_TIME    = 00:00:00
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会出错

/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
zboxloop.c:17:10: fatal error: _hypre_struct_mv.hpp: No such file or directory
   17 | #include "_hypre_struct_mv.hpp"
/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
In file included from sstruct.c:14:
/thfs1/home/***/hypre-master/src/hypre/include/HYPRE_sstruct_ls.h:14:10: fatal error: HYPRE_sstruct_mv.h: No such file or directory
   14 | #include "HYPRE_sstruct_mv.h"

没有MPI头文件:

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

没有链接mpi库

 /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
/usr/bin/ld: /thfs1/home/***/hypre-master/src/hypre/lib/libHYPRE.a(mpistubs.c.o): in function `hypre_MPI_Init':
mpistubs.c:(.text+0x8): undefined reference to `MPI_Init'
/usr/bin/ld: /thfs1/home/***/hypre-master/src/hypre/lib/libHYPRE.a(mpistubs.c.o): in function `hypre_MPI_Finalize':
mpistubs.c:(.text+0x10): undefined reference to `MPI_Finalize'
pcg.c:(.text+0x8b4): undefined reference to `pow'
/usr/bin/ld: pcg.c:(.text+0xc00): undefined reference to `sqrt'
/usr/bin/ld: pcg.c:(.text+0xf28): undefined reference to `sqrt'
/usr/bin/ld: pcg.c:(.text+0xf48): undefined reference to `sqrt'
/usr/bin/ld: pcg.c:(.text+0xf58): undefined reference to `sqrt'

还有sin, cos没有的

解决方法:

修改 config/Makefile.config

107 ##################################################################
108 ##  MPI options
109 ##################################################################
110 MPIINCLUDE = -I/thfs1/software/mpich/mpi-n-gcc9.3.0/include
111 MPILIBDIRS = -I/thfs1/software/mpich/mpi-n-gcc9.3.0/lib
112 MPILIBS    = -lmpi
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

输出 没有问题
 

CPU #OMP THREADS 1
  Laplacian:   num_fun = 1
    (nx, ny, nz) = (10, 10, 10)
    (Px, Py, Pz) = (1, 1, 1)
    (cx, cy, cz) = (1.000000, 1.000000, 1.000000)

=============================================
Generate Matrices:
=============================================
Generate Matrices:
  wall clock time = 0.000380 seconds
  wall MFLOPS     = 0.000000
  cpu clock time  = 0.000380 seconds
  cpu MFLOPS      = 0.000000

A 1000 x 1000, NNZ 6400, RNZ 6
--- rep 0 (out of 10) ---
--- rep 1 (out of 10) ---
--- rep 2 (out of 10) ---
--- rep 3 (out of 10) ---
--- rep 4 (out of 10) ---
--- rep 5 (out of 10) ---
--- rep 6 (out of 10) ---
--- rep 7 (out of 10) ---
--- rep 8 (out of 10) ---
--- rep 9 (out of 10) ---
=============================================
Device Parcsr Matrix-by-Matrix, A*A:
=============================================
Device Parcsr Matrix-by-Matrix, A*A:
  wall clock time = 0.000360 seconds
  wall MFLOPS     = 0.000000
  cpu clock time  = 0.000361 seconds
  cpu MFLOPS      = 0.000000

B 1000 x 1000, NNZ 20920, RNZ 20
 ./struct

Using HYPRE_RELEASE_VERSION: 2.26.0

Running with these driver parameters:
  (nx, ny, nz)    = (10, 10, 10)
  (istart[0],istart[1],istart[2]) = (-3, -3, -3)
  (Px, Py, Pz)    = (1, 1, 1)
  (bx, by, bz)    = (1, 1, 1)
  (px, py, pz)    = (0, 0, 0)
  (cx, cy, cz)    = (1.000000, 1.000000, 1.000000)
  (conx,cony,conz)= (0.000000, 0.000000, 0.000000)
  (n_pre, n_post) = (1, 1)
  dim             = 3
  skip            = 0
  sym             = 1
  rap             = 0
  relax           = 1
  jump            = 0
  solver ID       = 0
=============================================
Struct Interface:
=============================================
Struct Interface:
  wall clock time = 0.000384 seconds
  wall MFLOPS     = 0.000000
  cpu clock time  = 0.000385 seconds
  cpu MFLOPS      = 0.000000

=============================================
Setup phase times:
=============================================
SMG Setup:
  wall clock time = 0.009755 seconds
  wall MFLOPS     = 0.000000
  cpu clock time  = 0.009758 seconds
  cpu MFLOPS      = 0.000000

=============================================
Solve phase times:
=============================================
SMG Solve:
  wall clock time = 0.011196 seconds
  wall MFLOPS     = 0.000000
  cpu clock time  = 0.011011 seconds
  cpu MFLOPS      = 0.000000


Iterations = 5
Final Relative Residual Norm = 1.375560e-07

看起来没有问题。

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
天河超算是中国的超级计算机,在使用过程中,安装conda是非常常见的操作之一。conda是一个用于管理不同编程语言的软件包和环境的工具,它可以帮助用户快速安装、更新和管理各种需要的软件包。 要在天河超算安装conda,首先需要登录到超算系统。然后,下载适用于Linux系统的conda安装包。可以通过在终端中运行wget命令来从官方网站上下载该安装包,如下所示: ```bash wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh ``` 下载完成后,可以运行以下命令来安装conda: ```bash bash Miniconda3-latest-Linux-x86_64.sh ``` 接下来,按照提示逐步进行安装。可以选择安装位置和将conda加入环境变量中,以便在任何位置均可访问conda。完成安装后,可以通过运行以下命令来激活conda: ```bash source ~/.bashrc ``` 激活后,可以使用conda命令进行各种操作。例如,可以创建和管理不同的Python环境,安装和更新各种Python库等。以下是几个使用conda的常见命令示例: - 创建一个名为myenv的Python环境:`conda create -n myenv python=3.8` - 激活myenv环境:`conda activate myenv` - 安装numpy库:`conda install numpy` - 更新numpy库:`conda update numpy` - 列出已安装的所有环境:`conda info --envs` 通过以上步骤,就可以在天河超算上成功安装并使用conda了。注意,在进行超算操作时,请遵循相关规定和权限,确保正确使用系统资源。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值