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: For versions of the Intel compiler < 18.x, one may need to specify 26 # the undocumented compiler option '-mP2OPT_hpo_vec_remainder=F', which 27 # disables generation of vectorized remainder loops; this works around 28 # some incorrect code generation. This option should NOT be used with later 29 # compiler versions -- it is detrimental to performance, and the behavior 30 # may change without warning because this is an undocumented option. 31 '--COPTFLAGS=-g -xMIC-AVX512 -O3', 32 '--CXXOPTFLAGS=-g -xMIC-AVX512 -O3', 33 '--FOPTFLAGS=-g -xMIC-AVX512 -O3', 34 # Use BLAS and LAPACK provided by Intel MKL. 35 # (Below only works when PrgEnv-intel is loaded; it is possible, but not 36 # straightfoward, to use MKL on Cray systems with non-Intel compilers.) 37 # If Cray libsci is preferred, comment out the line below. 38 '--with-blaslapack-lib=-mkl -L' + os.environ['MKLROOT'] + '/lib/intel64', 39 40 # Flags for the Cray compilers: 41# '--COPTFLAGS=-g -hcpu=mic-knl' 42# '--CXXOPTFLAGS=-g -hcpu=mic-knl' 43# '--FOPTFLAGS=-g -hcpu=mic-knl' 44 45 # Flags for the GCC compilers: 46# '--COPTFLAGS=-g -march=knl -O3 -mavx512f -mavx512cd -mavx512er -mavx512pf', 47# '--CXXOPTFLAGS=-g -march=knl -O3 -mavx512f -mavx512cd -mavx512er -mavx512pf', 48# '--FOPTFLAGS=-g -march=knl -O3 -mavx512f -mavx512cd -mavx512er -mavx512pf', 49 50 '--with-debugging=no', 51 '--with-memalign=64', 52 '--with-mpiexec=srun', # Some systems (e.g., ALCF Theta) use '--with-mpiexec=aprun' instead. 53 '--known-mpi-shared-libraries=1', 54 '--with-clib-autodetect=0', 55 '--with-fortranlib-autodetect=0', 56 '--with-cxxlib-autodetect=0', 57 '--LIBS=-lstdc++', 58 '--LDFLAGS=-dynamic', # Needed if wish to use dynamic shared libraries. 59 60 # Below "--known-" options are from the "reconfigure.py" script generated 61 # after an intial configure.py run using '--with-batch'. 62 '--known-level1-dcache-size=32768', 63 '--known-level1-dcache-linesize=64', 64 '--known-level1-dcache-assoc=8', 65 '--known-sizeof-char=1', 66 '--known-sizeof-void-p=8', 67 '--known-sizeof-short=2', 68 '--known-sizeof-int=4', 69 '--known-sizeof-long=8', 70 '--known-sizeof-long-long=8', 71 '--known-sizeof-float=4', 72 '--known-sizeof-double=8', 73 '--known-sizeof-size_t=8', 74 '--known-bits-per-byte=8', 75 '--known-memcmp-ok=1', 76 '--known-sizeof-MPI_Comm=4', 77 '--known-sizeof-MPI_Fint=4', 78 '--known-mpi-long-double=1', 79 '--known-mpi-int64_t=1', 80 '--known-mpi-c-double-complex=1', 81 '--known-sdot-returns-double=0', 82 '--known-snrm2-returns-double=0', 83 '--known-has-attribute-aligned=1', 84 '--known-snrm2-returns-double=0', 85 '--known-sdot-returns-double=0', 86 '--known-64-bit-blas-indices=0', 87 '--with-batch=1', 88 ] 89 configure.petsc_configure(configure_options) 90