xref: /petsc/config/examples/arch-olcf-summit-opt.py (revision 106e96dd8587c0e940a4d9f884cb75cbebdf026f)
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.
4*106e96ddSRichard 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    # The IBM XL Fortran compilers are currently not working with PETSc.
19d7b941d8SRichard Tran Mills    # For XL compilers, can disable Fortran as below:
20d7b941d8SRichard Tran Mills    #'--with-fc=0',
21d7b941d8SRichard Tran Mills
22d7b941d8SRichard Tran Mills    '--with-shared-libraries=1',
23d7b941d8SRichard Tran Mills
24d7b941d8SRichard Tran Mills    ############################################################
25d7b941d8SRichard Tran Mills    # Specify compiler optimization flags.
26d7b941d8SRichard Tran Mills    ############################################################
27d7b941d8SRichard Tran Mills
28d7b941d8SRichard Tran Mills    # The GCC, PGI, and IBM XL compilers are supported on Summit.
29d7b941d8SRichard Tran Mills    # Make sure that the correct compiler suite module is loaded,
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
57d7b941d8SRichard Tran Mills    # With GCC and PGI compilers, can download and build:
58d7b941d8SRichard Tran Mills    '--download-fblaslapack=1',
59d7b941d8SRichard Tran Mills
60d7b941d8SRichard Tran Mills    # Download and build does not work with the XL compilers.
61d7b941d8SRichard Tran Mills    # For this case, use ESSL. (ESSL does *not* work for builds with GCC and PGI.)
62d7b941d8SRichard Tran Mills    # Note that ESSL does not provide some of the LAPACK functions required by PETSc!
63d7b941d8SRichard Tran Mills    # On ORNL's Summit, one must 'module load' both the essl AND netlib-lapack modules:
64d7b941d8SRichard Tran Mills    #'--with-blaslapack-lib=-L' + os.environ['OLCF_ESSL_ROOT'] + '/lib64 -lessl -llapack',
65d7b941d8SRichard Tran Mills
66d7b941d8SRichard Tran Mills    ############################################################
67d7b941d8SRichard Tran Mills    # Enable GPU support through CUDA/CUSPARSE and ViennaCL.
68d7b941d8SRichard Tran Mills    ############################################################
69d7b941d8SRichard Tran Mills
70d7b941d8SRichard Tran Mills    '--with-cuda=1',
71d7b941d8SRichard Tran Mills    '--with-cudac=nvcc',
72d7b941d8SRichard Tran Mills    # nvcc reqires the user to specify host compiler name via "-ccbin" when using non-GCC compilers:
73d7b941d8SRichard Tran Mills    'CUDAFLAGS=-ccbin pgc++',  # For PGI
74d7b941d8SRichard Tran Mills    #'CUDAFLAGS=-ccbin xlc++_r',  # For IBM XL
75d7b941d8SRichard Tran Mills
76d7b941d8SRichard Tran Mills    '--download-viennacl=1',
77d7b941d8SRichard Tran Mills
78d7b941d8SRichard Tran Mills    ############################################################
79d7b941d8SRichard Tran Mills    # Now specify some commonly used optional packages.
80d7b941d8SRichard Tran Mills    ############################################################
81d7b941d8SRichard Tran Mills
82d7b941d8SRichard Tran Mills    '--with-hdf5-dir=' + os.environ['OLCF_HDF5_ROOT'],  # 'module load hdf5' to use the OLCF-provided build
83d7b941d8SRichard Tran Mills    '--download-metis=1',
84d7b941d8SRichard Tran Mills    '--download-parmetis=1',
85d7b941d8SRichard Tran Mills    '--download-triangle=1',
86d7b941d8SRichard Tran Mills    '--download-ctetgen=1',
87d7b941d8SRichard Tran Mills
88d7b941d8SRichard Tran Mills    # The below options do not work with the IBM XL compilers.
89d7b941d8SRichard Tran Mills    # Trying to use the OLCF-provided 'hypre' module also does not work.
90d7b941d8SRichard Tran Mills    '--download-hypre=1',
91d7b941d8SRichard Tran Mills    '--download-ml=1',
92d7b941d8SRichard Tran Mills
93d7b941d8SRichard Tran Mills  ]
94d7b941d8SRichard Tran Mills  configure.petsc_configure(configure_options)
95