TEAR-ERC / tandem

A HPC DG method for 2D and 3D SEAS problems
BSD 3-Clause "New" or "Revised" License
18 stars 10 forks source link

Building PETSc on LUMI #76

Open hpc4geo opened 2 months ago

hpc4geo commented 2 months ago

With a fresh linux environment I first load these modules

module load cray-mpich/8.1.29
module load craype-x86-trento
module load craype-accel-amd-gfx90a
module load rocm/6.0.3

module list reports the following

Currently Loaded Modules:
  1) libfabric/1.15.2.0                         7) lumi-tools/24.05    (S)  13) cray-mpich/8.1.29
  2) craype-network-ofi                         8) init-lumi/0.2       (S)  14) craype-x86-trento
  3) perftools-base/24.03.0                     9) craype/2.7.31.11         15) craype-accel-amd-gfx90a
  4) xpmem/2.8.2-1.0_5.1__g84a27a5.shasta      10) cray-dsmml/0.3.0         16) rocm/6.0.3
  5) cce/17.0.1                                11) cray-libsci/24.03.0
  6) ModuleLabel/label                    (S)  12) PrgEnv-cray/8.5.0
  1. PETSc typically found find one of the rocm headers. Hence you will need to set the following environment variable.
export CPATH=$ROCM_PATH/include/rocm-core:$CPATH
  1. Building PETSc developer version from the git repo (preferred)
    --download-c2html=0
    --download-cmake
    --download-fblaslapack=1
    --download-hwloc=0
    --download-metis
    --download-parmetis
    --download-sowing=0
    --with-64-bit-indices
    --with-fortran-bindings=0
    --with-hip
    --with-hip-arch=gfx90a
    --with-hipc=hipcc
    --with-memalign=32
    --with-mpi-dir=/opt/cray/pe/mpich/8.1.29/ofi/crayclang/17.0
    --with-x=0
    PETSC_ARCH=arch-cray-c-debug-rocm-hip-tandem-vanil
  1. Building PETSc from the release snapshot

PETSc-3.21.5_rocm6.patch

Thomas-Ulrich commented 1 month ago

I can confirm I could compile petsc@main with your method, that I sum up hereafter:

module load cray-mpich/8.1.29
module load craype-x86-trento
module load craype-accel-amd-gfx90a
module load rocm/6.0.3
export CPATH=$ROCM_PATH/include/rocm-core:$CPATH
export blas_dir=/opt/cray/pe/libsci/24.03.0/CRAYCLANG/17.0/x86_64
./configure --download-c2html=0 --download-cmake --with-debugging=no  --download-hwloc=0 --download-metis --download-parmetis --download-sowing=0 --with-64-bit-indices --with-fortran-bindings=0 --with-hip --with-hip-arch=gfx90a --with-hipc=hipcc --with-memalign=32 --with-mpi-dir=/opt/cray/pe/mpich/8.1.29/ofi/crayclang/17.0 --with-x=0 PETSC_ARCH=arch-cray-c-rocm-hip-tandem-vanille --with-blaslapack-lib="${blas_dir}/lib/libsci_cray.a ${blas_dir}/lib/libsci_cray.so ${blas_dir}/lib/libsci_cray_mpi.a ${blas_dir}/lib/libsci_cray_mpi.so"
make PETSC_DIR=/pfs/lustrep4/scratch/project_465000831/petsc PETSC_ARCH=arch-cray-c-rocm-hip-tandem-vanille all

, and then tandem, with these changes: changes_for_lumi.txt (slightly different from what you posted).

And then:

CC=/opt/rocm-6.0.3/bin/amdclang CXX=/opt/rocm-6.0.3/bin/amdclang++ cmake .. -DCMAKE_PREFIX_PATH=/scratch/project_465000831/petsc/./arch-cray-c-rocm-hip-tandem-vanille/ -DDOMAIN_DIMENSION=3 -DCMAKE_CXX_FLAGS="-I${MPICH_DIR}/include"  -DCMAKE_EXE_LINKER_FLAGS="-L${MPICH_DIR}/lib -lmpi ${PE_MPICH_GTL_DIR_amd_gfx90a} ${PE_MPICH_GTL_LIBS_amd_gfx90a}"

and then static is working fine. Thank you!