1df3bd252SSatish Balay#!/usr/bin/env python3 2d7b941d8SRichard Tran Mills 3d7b941d8SRichard Tran Mills# Example configure script for the IBM POWER9 and NVIDIA Volta GV100 "Summit" system at OLCF/ORNL. 4106e96ddSRichard Tran Mills# This may also be useful for the related Sierra system at LLNL, or other, similar systems that may appear. 500964b16SRichard Tran Mills# A compiler module and the 'cmake' and 'cuda' modules (in addition to a Python module!) should be loaded on Summit. 6d7b941d8SRichard Tran Mills# See inline comments below on other modules that might need to be loaded. 7d7b941d8SRichard Tran Mills 8d7b941d8SRichard Tran Millsif __name__ == '__main__': 9d7b941d8SRichard Tran Mills import os 10d7b941d8SRichard Tran Mills import sys 11d7b941d8SRichard Tran Mills sys.path.insert(0, os.path.abspath('config')) 12d7b941d8SRichard Tran Mills import configure 13d7b941d8SRichard Tran Mills configure_options = [ 14d7b941d8SRichard Tran Mills # We use the IBM Spectrum MPI compiler wrappers, regardless of the underlying compilers used. 15d7b941d8SRichard Tran Mills '--with-cc=mpicc', 16d7b941d8SRichard Tran Mills '--with-cxx=mpiCC', 17d7b941d8SRichard Tran Mills '--with-fc=mpifort', 18d7b941d8SRichard Tran Mills 193023170aSRichard Tran Mills '--with-make-np=8', # Must limit size of parallel build on Summit login nodes to be within resource quota imposed by OLCF. 203023170aSRichard Tran Mills 21d7b941d8SRichard Tran Mills '--with-shared-libraries=1', 22d7b941d8SRichard Tran Mills 23d7b941d8SRichard Tran Mills ############################################################ 24d7b941d8SRichard Tran Mills # Specify compiler optimization flags. 25d7b941d8SRichard Tran Mills ############################################################ 26d7b941d8SRichard Tran Mills 27d7b941d8SRichard Tran Mills # The GCC, PGI, and IBM XL compilers are supported on Summit. 28d7b941d8SRichard Tran Mills # Make sure that the correct compiler suite module is loaded, 29824c33e7SBarry Smith # module load gcc, pgi, or xl 30d7b941d8SRichard Tran Mills # and then comment/uncomment the appropriate stanzas below. 31d7b941d8SRichard Tran Mills # For optimized cases, more aggressive compilation flags can be tried, 32d7b941d8SRichard Tran Mills # but the examples below provide a reasonable start. 33d7b941d8SRichard Tran Mills 34d7b941d8SRichard Tran Mills # If a debug build is desired, use the following for any of the compilers: 35d7b941d8SRichard Tran Mills #'--with-debugging=yes', 36d7b941d8SRichard Tran Mills #'COPTFLAGS=-g', 37d7b941d8SRichard Tran Mills #'CXXOPTFLAGS=-g', 38d7b941d8SRichard Tran Mills #'FOPTFLAGS=-g', 39d7b941d8SRichard Tran Mills 40d7b941d8SRichard Tran Mills # For production builds, disable PETSc debugging support: 41d7b941d8SRichard Tran Mills '--with-debugging=no', 42d7b941d8SRichard Tran Mills 43d7b941d8SRichard Tran Mills # Optimized flags for PGI: 44d7b941d8SRichard Tran Mills 'COPTFLAGS=-g -fast', 45d7b941d8SRichard Tran Mills 'CXXOPTFLAGS=-g -fast', 46d7b941d8SRichard Tran Mills 'FOPTFLAGS=-g -fast', 47d7b941d8SRichard Tran Mills 48d7b941d8SRichard Tran Mills # Optimized flags for XL or GCC: 49d7b941d8SRichard Tran Mills #'--COPTFLAGS=-g -Ofast -mcpu=power9', 50d7b941d8SRichard Tran Mills #'--CXXOPTFLAGS=-g -Ofast -mcpu=power9', 51d7b941d8SRichard Tran Mills #'--FOPTFLAGS=-g -Ofast -mcpu=power9', 52d7b941d8SRichard Tran Mills 53d7b941d8SRichard Tran Mills ############################################################ 54d7b941d8SRichard Tran Mills # Specify BLAS and LAPACK. 55d7b941d8SRichard Tran Mills ############################################################ 56d7b941d8SRichard Tran Mills 57105ead69SJed Brown # Note: ESSL does not provide all functions used by PETSc, so we link netlib LAPACK as well. 58d7b941d8SRichard Tran Mills # On ORNL's Summit, one must 'module load' both the essl AND netlib-lapack modules: 59105ead69SJed Brown '--with-blaslapack-lib=-L' + os.environ['OLCF_ESSL_ROOT'] + '/lib64 -lessl -llapack -lessl', 60105ead69SJed Brown 61105ead69SJed Brown # An alternative in case of difficulty with ESSL is to download/build a portable implementation such as: 62105ead69SJed Brown #'--download-fblaslapack=1', 63105ead69SJed Brown #'--download-f2cblaslapack', '--download-blis', 64d7b941d8SRichard Tran Mills 65d7b941d8SRichard Tran Mills ############################################################ 66d7b941d8SRichard Tran Mills # Enable GPU support through CUDA/CUSPARSE and ViennaCL. 67d7b941d8SRichard Tran Mills ############################################################ 68d7b941d8SRichard Tran Mills 69d7b941d8SRichard Tran Mills '--with-cuda=1', 70d7b941d8SRichard Tran Mills '--with-cudac=nvcc', 71*d5b43468SJose E. Roman # nvcc requires the user to specify host compiler name via "-ccbin" when using non-GCC compilers: 72d7b941d8SRichard Tran Mills 'CUDAFLAGS=-ccbin pgc++', # For PGI 73d7b941d8SRichard Tran Mills #'CUDAFLAGS=-ccbin xlc++_r', # For IBM XL 74d7b941d8SRichard Tran Mills 75d7b941d8SRichard Tran Mills '--download-viennacl=1', 76d7b941d8SRichard Tran Mills 77d7b941d8SRichard Tran Mills ############################################################ 78d7b941d8SRichard Tran Mills # Now specify some commonly used optional packages. 79d7b941d8SRichard Tran Mills ############################################################ 80d7b941d8SRichard Tran Mills 81d7b941d8SRichard Tran Mills '--with-hdf5-dir=' + os.environ['OLCF_HDF5_ROOT'], # 'module load hdf5' to use the OLCF-provided build 82d7b941d8SRichard Tran Mills '--download-metis=1', 83d7b941d8SRichard Tran Mills '--download-parmetis=1', 84d7b941d8SRichard Tran Mills '--download-triangle=1', 85d7b941d8SRichard Tran Mills '--download-ctetgen=1', 86d7b941d8SRichard Tran Mills 87824c33e7SBarry Smith # The options below do not work with the IBM XL compilers. 88d7b941d8SRichard Tran Mills # Trying to use the OLCF-provided 'hypre' module also does not work. 89d7b941d8SRichard Tran Mills '--download-hypre=1', 90d7b941d8SRichard Tran Mills '--download-ml=1', 91d7b941d8SRichard Tran Mills 92d7b941d8SRichard Tran Mills ] 93d7b941d8SRichard Tran Mills configure.petsc_configure(configure_options) 94