-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Summary
HPE Cray supercomputers provide the native crayftn Fortran compiler for building executables that are optimised to Cray hardware. The compiler has notably stricter coding standards than other compilers such as gfortran. Previous versions of ReMKiT1D (v1.1.0) were reported to be crayftn compatible, but compatibility has been lost since.
While it is possible to use gfortran on Cray systems, it would be ideal to optimise ReMKiT1D for production runs in the future.
To-do (being updated)
See below comments for descriptions of these issues:
- 1. Restructure interface-procedure pattern in assertion_utility.f90 (and others if applicable).
- 2. Restructure CVODEIntegrator, ensuring function checked by FCVODEInit and FCVBBDPrecInit exists at module scope and not subroutine scope.
Repro steps (ARCHER2 Supercomputer)
Using the default environment on ARCHER2, where Cray PE (compilers), Cray-mpich (MPI) and Cray-libsci (BLAS and LAPACK) are pre-loaded, set a work directory, and load the preinstalled CMake and Cray-HDF5:
# ReMKiT1D and its dependencies live here
export RMKROOT=<enter your path here>
# Use Cray compilers and the pre-installed version of CMake
module load cmake/3.18.4 cray-hdf5/1.12.2.7
export FC=ftn
export CC=cc
# Subdirectory for dependencies
REQ_LIBS_PATH=$RMKROOT/remkit1d_reqs_cray
mkdir $REQ_LIBS_PATH
cd $REQ_LIBS_PATH
# A further subdirectory for dependency installs
mkdir lib_installsBuild and configure PETSc, build and install SUNDIALS and json-fortran, then ReMKiT1D.
#!/bin/bash
# Install and configure PETSc with hypre
git clone -b release-3.17 https://gitlab.com/petsc/petsc.git petsc
cd petsc
./configure --download-hypre=1 PETSC_ARCH=arch-opt-hypre --with-debugging=no COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3
make PETSC_DIR=$REQ_LIBS_PATH/petsc PETSC_ARCH=arch-opt-hypre all
cd $REQ_LIBS_PATH
# Install SUNDIALS
git clone https://github.com/LLNL/sundials.git
cd sundials
mkdir build
cd build
cmake \
-DENABLE_MPI=ON \
-DCMAKE_INSTALL_PREFIX=$REQ_LIBS_PATH/lib_installs/sundials \
-DENABLE_LAPACK=ON \
-DLAPACK_LIBRARIES="${CRAY_LIBSCI_PREFIX_DIR}/lib/libsci_cray_mpi.so" \
-DBUILD_FORTRAN_MODULE_INTERFACE=ON \
-DCMAKE_Fortran_COMPILER=$FC \
-DCMAKE_C_COMPILER=$CC \
..
make install
cd $REQ_LIBS_PATH
# Install json-fortran
git clone -b 8.2.5 https://github.com/jacobwilliams/json-fortran.git
cd json-fortran
mkdir build
cd build
cmake .. -DCMAKE_Fortran_COMPILER=$FC -DCMAKE_INSTALL_PREFIX=$REQ_LIBS_PATH/lib_installs/json-fortran -DSKIP_DOC_GEN=TRUE
make install
cd $RMKROOT
# Build ReMKiT1D itself - The flag -eZ enables pre-processor statements
git clone -b v1.3.0-branch https://github.com/ukaea/ReMKiT1D.git
cd ReMKiT1D
mkdir build
cd build
cmake .. -DCMAKE_Fortran_FLAGS="-eZ"
make
export RMKEXE=$RMKROOT/ReMKiT1D/build/src/executables/ReMKiT1D/ReMKiT1D