1#!/usr/bin/python 2 3# Example configure script for Cray XC-series systems with Intel "Knights 4# Landing" (KNL) processors. 5# This script was constructed for and tested on the Cori XC40 system, but 6# should work (or be easily modified to do so) on other Cray XC-series systems. 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 Cray compiler wrappers below, regardless of what underlying 15 # compilers we are actually using. 16 '--with-cc=cc', 17 '--with-cxx=CC', 18 '--with-fc=ftn', 19 20 # Cray supports the use of Intel, Cray, or GCC compilers. 21 # Make sure that the correct programming environment module is loaded, 22 # and then comment/uncomment the apprpriate stanzas below. 23 24 # Flags for the Intel compilers: 25 # NOTE: We are specifying the undocumented compiler option 26 # '-mP2OPT_hpo_vec_remainder=F', which disables generation of vectorized 27 # remainder loops; this works around some incorrect code generation in the 28 # Intel compiler version 17.0, up to and including version 17.0.4 29 # This option has not been tested, and should NOT be used, with later 30 # compiler versions -- the behavior may change without warning between 31 # versions. It is anticipated that the code generation issue will be fixed 32 # in the version 18 compiler at release. 33 '--COPTFLAGS=-g -xMIC-AVX512 -O3 -mP2OPT_hpo_vec_remainder=F', 34 '--CXXOPTFLAGS=-g -xMIC-AVX512 -O3 -mP2OPT_hpo_vec_remainder=F', 35 '--FOPTFLAGS=-g -xMIC-AVX512 -O3 -mP2OPT_hpo_vec_remainder=F', 36 # Use BLAS and LAPACK provided by Intel MKL. 37 # (Below only works when PrgEnv-intel is loaded; it is possible, but not 38 # straightfoward, to use MKL on Cray systems with non-Intel compilers.) 39 # If Cray libsci is preferred, comment out the line below. 40 '--with-blaslapack-lib=-mkl -L' + os.environ['MKLROOT'] + '/lib/intel64', 41 42 # Flags for the Cray compilers: 43# '--COPTFLAGS=-g -hcpu=mic-knl' 44# '--CXXOPTFLAGS=-g -hcpu=mic-knl' 45# '--FOPTFLAGS=-g -hcpu=mic-knl' 46 47 # Flags for the GCC compilers: 48# '--COPTFLAGS=-g -march=knl -O3 -mavx512f -mavx512cd -mavx512er -mavx512pf', 49# '--CXXOPTFLAGS=-g -march=knl -O3 -mavx512f -mavx512cd -mavx512er -mavx512pf', 50# '--FOPTFLAGS=-g -march=knl -O3 -mavx512f -mavx512cd -mavx512er -mavx512pf', 51 52 '--with-debugging=no', 53 '--with-memalign=64', 54 '--with-mpiexec=srun', # Some systems (e.g., ALCF Theta) use '--with-mpiexec=aprun' instead. 55 '--known-mpi-shared-libraries=1', 56 '--with-clib-autodetect=0', 57 '--with-fortranlib-autodetect=0', 58 '--with-cxxlib-autodetect=0', 59 '--LIBS=-lstdc++', 60 '--LDFLAGS=-dynamic', # Needed if wish to use dynamic shared libraries. 61 62 # Below "--known-" options are from the "reconfigure.py" script generated 63 # after an intial configure.py run using '--with-batch'. 64 '--known-level1-dcache-size=32768', 65 '--known-level1-dcache-linesize=64', 66 '--known-level1-dcache-assoc=8', 67 '--known-sizeof-char=1', 68 '--known-sizeof-void-p=8', 69 '--known-sizeof-short=2', 70 '--known-sizeof-int=4', 71 '--known-sizeof-long=8', 72 '--known-sizeof-long-long=8', 73 '--known-sizeof-float=4', 74 '--known-sizeof-double=8', 75 '--known-sizeof-size_t=8', 76 '--known-bits-per-byte=8', 77 '--known-memcmp-ok=1', 78 '--known-sizeof-MPI_Comm=4', 79 '--known-sizeof-MPI_Fint=4', 80 '--known-mpi-long-double=1', 81 '--known-mpi-int64_t=1', 82 '--known-mpi-c-double-complex=1', 83 '--known-sdot-returns-double=0', 84 '--known-snrm2-returns-double=0', 85 '--known-has-attribute-aligned=1', 86 '--with-batch=1', 87 ] 88 configure.petsc_configure(configure_options) 89