xref: /petsc/config/examples/arch-olcf-summit-opt.py (revision 534a8f05a7a8aff70dd8cfd53d9cd834400a8dbf)
1#!/usr/bin/python
2
3# Example configure script for the IBM POWER9 and NVIDIA Volta GV100 "Summit" system at OLCF/ORNL.
4# This may also be useful for the related Sierra system at LLNL, or other, similar systems that may appear.
5# A compiler module and the 'cmake' and 'cuda' modules should be loaded on Summit.
6# See inline comments below on other modules that might need to be loaded.
7
8if __name__ == '__main__':
9  import os
10  import sys
11  sys.path.insert(0, os.path.abspath('config'))
12  import configure
13  configure_options = [
14    # We use the IBM Spectrum MPI compiler wrappers, regardless of the underlying compilers used.
15    '--with-cc=mpicc',
16    '--with-cxx=mpiCC',
17    '--with-fc=mpifort',
18
19    '--with-shared-libraries=1',
20
21    ############################################################
22    # Specify compiler optimization flags.
23    ############################################################
24
25    # The GCC, PGI, and IBM XL compilers are supported on Summit.
26    # Make sure that the correct compiler suite module is loaded,
27    #   module load gcc, pgi, or xl
28    # and then comment/uncomment the appropriate stanzas below.
29    # For optimized cases, more aggressive compilation flags can be tried,
30    # but the examples below provide a reasonable start.
31
32    # If a debug build is desired, use the following for any of the compilers:
33    #'--with-debugging=yes',
34    #'COPTFLAGS=-g',
35    #'CXXOPTFLAGS=-g',
36    #'FOPTFLAGS=-g',
37
38    # For production builds, disable PETSc debugging support:
39    '--with-debugging=no',
40
41    # Optimized flags for PGI:
42    'COPTFLAGS=-g -fast',
43    'CXXOPTFLAGS=-g -fast',
44    'FOPTFLAGS=-g -fast',
45
46    # Optimized flags for XL or GCC:
47    #'--COPTFLAGS=-g -Ofast -mcpu=power9',
48    #'--CXXOPTFLAGS=-g -Ofast -mcpu=power9',
49    #'--FOPTFLAGS=-g -Ofast -mcpu=power9',
50
51    ############################################################
52    # Specify BLAS and LAPACK.
53    ############################################################
54
55    # With GCC and PGI compilers, can download and build:
56    '--download-fblaslapack=1',
57
58    # Download and build does not work with the XL compilers.
59    # For this case, use ESSL. (ESSL does *not* work for builds with GCC and PGI.)
60    # Note that ESSL does not provide some of the LAPACK functions required by PETSc!
61    # On ORNL's Summit, one must 'module load' both the essl AND netlib-lapack modules:
62    #'--with-blaslapack-lib=-L' + os.environ['OLCF_ESSL_ROOT'] + '/lib64 -lessl -llapack',
63
64    ############################################################
65    # Enable GPU support through CUDA/CUSPARSE and ViennaCL.
66    ############################################################
67
68    '--with-cuda=1',
69    '--with-cudac=nvcc',
70    # nvcc reqires the user to specify host compiler name via "-ccbin" when using non-GCC compilers:
71    'CUDAFLAGS=-ccbin pgc++',  # For PGI
72    #'CUDAFLAGS=-ccbin xlc++_r',  # For IBM XL
73
74    '--download-viennacl=1',
75
76    ############################################################
77    # Now specify some commonly used optional packages.
78    ############################################################
79
80    '--with-hdf5-dir=' + os.environ['OLCF_HDF5_ROOT'],  # 'module load hdf5' to use the OLCF-provided build
81    '--download-metis=1',
82    '--download-parmetis=1',
83    '--download-triangle=1',
84    '--download-ctetgen=1',
85
86    # The options below do not work with the IBM XL compilers.
87    # Trying to use the OLCF-provided 'hypre' module also does not work.
88    '--download-hypre=1',
89    '--download-ml=1',
90
91  ]
92  configure.petsc_configure(configure_options)
93