1#!/usr/bin/python3 2 3# Use GNU compilers: 4# 5# Note cray-libsci provides BLAS etc. In summary, we have 6# module use /soft/modulefiles 7# module unload darshan 8# module load cudatoolkit-standalone/12.4.1 PrgEnv-gnu cray-libsci 9# 10# $ module list 11# Currently Loaded Modules: 12# 1) libfabric/1.15.2.0 6) nghttp2/1.57.0-ciat5hu 11) cray-dsmml/0.2.2 16) craype-x86-milan 13# 2) craype-network-ofi 7) curl/8.4.0-2ztev25 12) cray-mpich/8.1.28 17) PrgEnv-gnu/8.5.0 14# 3) perftools-base/23.12.0 8) cmake/3.27.7 13) cray-pmi/6.1.13 18) cray-libsci/23.12.5 15# 4) gcc-native/12.3 9) cudatoolkit-standalone/12.4.1 14) cray-pals/1.3.4 16# 5) spack-pe-base/0.6.1 10) craype/2.7.30 15) cray-libpals/1.3.4 17 18if __name__ == '__main__': 19 import sys 20 import os 21 sys.path.insert(0, os.path.abspath('config')) 22 import configure 23 configure_options = [ 24 '--with-cc=cc', 25 '--with-cxx=CC', 26 '--with-fc=ftn', 27 '--with-debugging=0', 28 '--with-cuda', 29 '--with-cudac=nvcc', 30 '--with-cuda-arch=80', # Since there is no easy way to auto-detect the cuda arch on the gpu-less Polaris login nodes, we explicitly set it. 31 '--download-kokkos', 32 '--download-kokkos-kernels', 33 '--download-hypre', 34 ] 35 configure.petsc_configure(configure_options) 36 37# Use NVHPC compilers 38# 39# Unset so that cray won't add -gpu to nvc even when craype-accel-nvidia80 is loaded 40# unset CRAY_ACCEL_TARGET 41# module load nvhpc/22.11 PrgEnv-nvhpc 42# 43# I met two problems with nvhpc and Kokkos (and Kokkos-Kernels) 4.2.0. 44# 1) Kokkos-Kernles failed at configuration to find TPL cublas and cusparse from NVHPC. 45# As a workaround, I just load cudatoolkit-standalone/11.8.0 to let KK use cublas and cusparse from cudatoolkit-standalone. 46# 2) KK failed at compilation 47# "/home/jczhang/petsc/arch-kokkos-dbg/externalpackages/git.kokkos-kernels/batched/dense/impl/KokkosBatched_Gemm_Serial_Internal.hpp", line 94: error: expression must have a constant value 48# constexpr int nbAlgo = Algo::Gemm::Blocked::mb(); 49# ^ 50# "/home/jczhang/petsc/arch-kokkos-dbg/externalpackages/git.kokkos-kernels/blas/impl/KokkosBlas_util.hpp", line 58: note: cannot call non-constexpr function "__builtin_is_device_code" (declared implicitly) 51# KOKKOS_IF_ON_HOST((return 4;)) 52# ^ 53# detected during: 54# 55# It is a KK problem and I have to wait for their fix. 56