Tianhe supercomputer, install Hypre

1) Download, unzip

slightly

Get directory: hypre-master

The source files are under the src directory

src contains the following directories:

 

 

2) cmake compile

newer version

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

generated:

 6564172 Nov 28 11:30 libHYPRE.a
 

3) Compile the example

cd hypre-master/src/test

make error

/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"

Without the MPI headers:

/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"
      |          ^~~~~~~

not linking mpi library

 /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'

There are sin, cos not

Solution:

Modify 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   =

The above is the mpi header file, library, and link function, etc.

added -lm

The header file of Hypre itself is missing, you may need to configure this config/Makefile.config as well

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

So I cp all the different .h and .hpp to the /thfs1/home/***/hypre-master/src/hypre/include directory.

4)

make

Generated various executables

 

run ./ij_mm

output is ok
 

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

Looks fine.

Guess you like

Origin blog.csdn.net/anlongstar/article/details/128075908