File: arch-olcf-summit-opt.py

package info (click to toggle)
petsc 3.23.1%2Bdfsg1-1exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 515,576 kB
  • sloc: ansic: 751,607; cpp: 51,542; python: 38,598; f90: 17,352; javascript: 3,493; makefile: 3,157; sh: 1,502; xml: 619; objc: 445; java: 13; csh: 1
file content (93 lines) | stat: -rwxr-xr-x 3,730 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/env python3

# Example configure script for the IBM POWER9 and NVIDIA Volta GV100 "Summit" system at OLCF/ORNL.
# This may also be useful for the related Sierra system at LLNL, or other, similar systems that may appear.
# A compiler module and the 'cmake' and 'cuda' modules (in addition to a Python module!) should be loaded on Summit.
# See inline comments below on other modules that might need to be loaded. 

if __name__ == '__main__':
  import os
  import sys
  sys.path.insert(0, os.path.abspath('config'))
  import configure
  configure_options = [
    # We use the IBM Spectrum MPI compiler wrappers, regardless of the underlying compilers used.
    '--with-cc=mpicc',
    '--with-cxx=mpiCC',
    '--with-fc=mpifort',

    '--with-make-np=8', # Must limit size of parallel build on Summit login nodes to be within resource quota imposed by OLCF.

    '--with-shared-libraries=1',

    ############################################################
    # Specify compiler optimization flags.
    ############################################################

    # The GCC, PGI, and IBM XL compilers are supported on Summit.
    # Make sure that the correct compiler suite module is loaded,
    #   module load gcc, pgi, or xl
    # and then comment/uncomment the appropriate stanzas below.
    # For optimized cases, more aggressive compilation flags can be tried,
    # but the examples below provide a reasonable start.

    # If a debug build is desired, use the following for any of the compilers:
    #'--with-debugging=yes',
    #'COPTFLAGS=-g',
    #'CXXOPTFLAGS=-g',
    #'FOPTFLAGS=-g',

    # For production builds, disable PETSc debugging support:
    '--with-debugging=no',

    # Optimized flags for PGI:
    'COPTFLAGS=-g -fast',
    'CXXOPTFLAGS=-g -fast',
    'FOPTFLAGS=-g -fast',

    # Optimized flags for XL or GCC:
    #'--COPTFLAGS=-g -Ofast -mcpu=power9',
    #'--CXXOPTFLAGS=-g -Ofast -mcpu=power9',
    #'--FOPTFLAGS=-g -Ofast -mcpu=power9',

    ############################################################
    # Specify BLAS and LAPACK.
    ############################################################

    # Note: ESSL does not provide all functions used by PETSc, so we link netlib LAPACK as well.
    # On ORNL's Summit, one must 'module load' both the essl AND netlib-lapack modules:
    '--with-blaslapack-lib=-L' + os.environ['OLCF_ESSL_ROOT'] + '/lib64 -lessl -llapack -lessl',

    # An alternative in case of difficulty with ESSL is to download/build a portable implementation such as:
    #'--download-fblaslapack=1',
    #'--download-f2cblaslapack', '--download-blis',

    ############################################################
    # Enable GPU support through CUDA/CUSPARSE and ViennaCL.
    ############################################################

    '--with-cuda=1',
    '--with-cudac=nvcc',
    # nvcc requires the user to specify host compiler name via "-ccbin" when using non-GCC compilers:
    'CUDAFLAGS=-ccbin pgc++',  # For PGI
    #'CUDAFLAGS=-ccbin xlc++_r',  # For IBM XL

    '--download-viennacl=1',

    ############################################################
    # Now specify some commonly used optional packages.
    ############################################################

    '--with-hdf5-dir=' + os.environ['OLCF_HDF5_ROOT'],  # 'module load hdf5' to use the OLCF-provided build
    '--download-metis=1',
    '--download-parmetis=1',
    '--download-triangle=1',
    '--download-ctetgen=1',

    # The options below do not work with the IBM XL compilers.
    # Trying to use the OLCF-provided 'hypre' module also does not work.
    '--download-hypre=1',
    '--download-ml=1',

  ] 
  configure.petsc_configure(configure_options)