xref: /petsc/config/examples/arch-olcf-summit-opt.py (revision 105ead6976887dcb199b5ed68ec9fa3dadc12057)
1d7b941d8SRichard Tran Mills#!/usr/bin/python
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.
5d7b941d8SRichard Tran Mills# A compiler module and the 'cmake' and 'cuda' modules 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
19d7b941d8SRichard Tran Mills    '--with-shared-libraries=1',
20d7b941d8SRichard Tran Mills
21d7b941d8SRichard Tran Mills    ############################################################
22d7b941d8SRichard Tran Mills    # Specify compiler optimization flags.
23d7b941d8SRichard Tran Mills    ############################################################
24d7b941d8SRichard Tran Mills
25d7b941d8SRichard Tran Mills    # The GCC, PGI, and IBM XL compilers are supported on Summit.
26d7b941d8SRichard Tran Mills    # Make sure that the correct compiler suite module is loaded,
27824c33e7SBarry Smith    #   module load gcc, pgi, or xl
28d7b941d8SRichard Tran Mills    # and then comment/uncomment the appropriate stanzas below.
29d7b941d8SRichard Tran Mills    # For optimized cases, more aggressive compilation flags can be tried,
30d7b941d8SRichard Tran Mills    # but the examples below provide a reasonable start.
31d7b941d8SRichard Tran Mills
32d7b941d8SRichard Tran Mills    # If a debug build is desired, use the following for any of the compilers:
33d7b941d8SRichard Tran Mills    #'--with-debugging=yes',
34d7b941d8SRichard Tran Mills    #'COPTFLAGS=-g',
35d7b941d8SRichard Tran Mills    #'CXXOPTFLAGS=-g',
36d7b941d8SRichard Tran Mills    #'FOPTFLAGS=-g',
37d7b941d8SRichard Tran Mills
38d7b941d8SRichard Tran Mills    # For production builds, disable PETSc debugging support:
39d7b941d8SRichard Tran Mills    '--with-debugging=no',
40d7b941d8SRichard Tran Mills
41d7b941d8SRichard Tran Mills    # Optimized flags for PGI:
42d7b941d8SRichard Tran Mills    'COPTFLAGS=-g -fast',
43d7b941d8SRichard Tran Mills    'CXXOPTFLAGS=-g -fast',
44d7b941d8SRichard Tran Mills    'FOPTFLAGS=-g -fast',
45d7b941d8SRichard Tran Mills
46d7b941d8SRichard Tran Mills    # Optimized flags for XL or GCC:
47d7b941d8SRichard Tran Mills    #'--COPTFLAGS=-g -Ofast -mcpu=power9',
48d7b941d8SRichard Tran Mills    #'--CXXOPTFLAGS=-g -Ofast -mcpu=power9',
49d7b941d8SRichard Tran Mills    #'--FOPTFLAGS=-g -Ofast -mcpu=power9',
50d7b941d8SRichard Tran Mills
51d7b941d8SRichard Tran Mills    ############################################################
52d7b941d8SRichard Tran Mills    # Specify BLAS and LAPACK.
53d7b941d8SRichard Tran Mills    ############################################################
54d7b941d8SRichard Tran Mills
55*105ead69SJed Brown    # Note: ESSL does not provide all functions used by PETSc, so we link netlib LAPACK as well.
56d7b941d8SRichard Tran Mills    # On ORNL's Summit, one must 'module load' both the essl AND netlib-lapack modules:
57*105ead69SJed Brown    '--with-blaslapack-lib=-L' + os.environ['OLCF_ESSL_ROOT'] + '/lib64 -lessl -llapack -lessl',
58*105ead69SJed Brown
59*105ead69SJed Brown    # An alternative in case of difficulty with ESSL is to download/build a portable implementation such as:
60*105ead69SJed Brown    #'--download-fblaslapack=1',
61*105ead69SJed Brown    #'--download-f2cblaslapack', '--download-blis',
62d7b941d8SRichard Tran Mills
63d7b941d8SRichard Tran Mills    ############################################################
64d7b941d8SRichard Tran Mills    # Enable GPU support through CUDA/CUSPARSE and ViennaCL.
65d7b941d8SRichard Tran Mills    ############################################################
66d7b941d8SRichard Tran Mills
67d7b941d8SRichard Tran Mills    '--with-cuda=1',
68d7b941d8SRichard Tran Mills    '--with-cudac=nvcc',
69d7b941d8SRichard Tran Mills    # nvcc reqires the user to specify host compiler name via "-ccbin" when using non-GCC compilers:
70d7b941d8SRichard Tran Mills    'CUDAFLAGS=-ccbin pgc++',  # For PGI
71d7b941d8SRichard Tran Mills    #'CUDAFLAGS=-ccbin xlc++_r',  # For IBM XL
72d7b941d8SRichard Tran Mills
73d7b941d8SRichard Tran Mills    '--download-viennacl=1',
74d7b941d8SRichard Tran Mills
75d7b941d8SRichard Tran Mills    ############################################################
76d7b941d8SRichard Tran Mills    # Now specify some commonly used optional packages.
77d7b941d8SRichard Tran Mills    ############################################################
78d7b941d8SRichard Tran Mills
79d7b941d8SRichard Tran Mills    '--with-hdf5-dir=' + os.environ['OLCF_HDF5_ROOT'],  # 'module load hdf5' to use the OLCF-provided build
80d7b941d8SRichard Tran Mills    '--download-metis=1',
81d7b941d8SRichard Tran Mills    '--download-parmetis=1',
82d7b941d8SRichard Tran Mills    '--download-triangle=1',
83d7b941d8SRichard Tran Mills    '--download-ctetgen=1',
84d7b941d8SRichard Tran Mills
85824c33e7SBarry Smith    # The options below do not work with the IBM XL compilers.
86d7b941d8SRichard Tran Mills    # Trying to use the OLCF-provided 'hypre' module also does not work.
87d7b941d8SRichard Tran Mills    '--download-hypre=1',
88d7b941d8SRichard Tran Mills    '--download-ml=1',
89d7b941d8SRichard Tran Mills
90d7b941d8SRichard Tran Mills  ]
91d7b941d8SRichard Tran Mills  configure.petsc_configure(configure_options)
92