13edb0b5bSRichard Tran Mills#!/usr/bin/python 23edb0b5bSRichard Tran Mills 33edb0b5bSRichard Tran Mills# Example configure script for Cray XC-series systems with Intel "Knights 43edb0b5bSRichard Tran Mills# Landing" (KNL) processors. 53edb0b5bSRichard Tran Mills# This script was constructed for and tested on the Cori XC40 system, but 63edb0b5bSRichard Tran Mills# should work (or be easily modified to do so) on other Cray XC-series systems. 73edb0b5bSRichard Tran Mills 83edb0b5bSRichard Tran Millsif __name__ == '__main__': 93edb0b5bSRichard Tran Mills import os 103edb0b5bSRichard Tran Mills import sys 113edb0b5bSRichard Tran Mills sys.path.insert(0, os.path.abspath('config')) 123edb0b5bSRichard Tran Mills import configure 133edb0b5bSRichard Tran Mills configure_options = [ 143edb0b5bSRichard Tran Mills # We use the Cray compiler wrappers below, regardless of what underlying 153edb0b5bSRichard Tran Mills # compilers we are actually using. 163edb0b5bSRichard Tran Mills '--with-cc=cc', 173edb0b5bSRichard Tran Mills '--with-cxx=CC', 183edb0b5bSRichard Tran Mills '--with-fc=ftn', 193edb0b5bSRichard Tran Mills 203edb0b5bSRichard Tran Mills # Cray supports the use of Intel, Cray, or GCC compilers. 213edb0b5bSRichard Tran Mills # Make sure that the correct programming environment module is loaded, 223edb0b5bSRichard Tran Mills # and then comment/uncomment the apprpriate stanzas below. 233edb0b5bSRichard Tran Mills 243edb0b5bSRichard Tran Mills # Flags for the Intel compilers: 253edb0b5bSRichard Tran Mills # NOTE: We are specifying the undocumented compiler option 263edb0b5bSRichard Tran Mills # '-mP2OPT_hpo_vec_remainder=F', which disables generation of vectorized 273edb0b5bSRichard Tran Mills # remainder loops; this works around some incorrect code generation in the 283edb0b5bSRichard Tran Mills # Intel compiler version 17.0, up to and including version 17.0.4 293edb0b5bSRichard Tran Mills # This option has not been tested, and should NOT be used, with later 303edb0b5bSRichard Tran Mills # compiler versions -- the behavior may change without warning between 313edb0b5bSRichard Tran Mills # versions. It is anticipated that the code generation issue will be fixed 32*01ab9332SRichard Tran Mills # in the version 18 compiler at release. 333edb0b5bSRichard Tran Mills '--COPTFLAGS=-g -xMIC-AVX512 -O3 -mP2OPT_hpo_vec_remainder=F', 343edb0b5bSRichard Tran Mills '--CXXOPTFLAGS=-g -xMIC-AVX512 -O3 -mP2OPT_hpo_vec_remainder=F', 353edb0b5bSRichard Tran Mills '--FOPTFLAGS=-g -xMIC-AVX512 -O3 -mP2OPT_hpo_vec_remainder=F', 363edb0b5bSRichard Tran Mills # Use BLAS and LAPACK provided by Intel MKL. 373edb0b5bSRichard Tran Mills # (Below only works when PrgEnv-intel is loaded; it is possible, but not 383edb0b5bSRichard Tran Mills # straightfoward, to use MKL on Cray systems with non-Intel compilers.) 393edb0b5bSRichard Tran Mills # If Cray libsci is preferred, comment out the line below. 403edb0b5bSRichard Tran Mills '--with-blaslapack-lib=-mkl -L' + os.environ['MKLROOT'] + '/lib/intel64', 413edb0b5bSRichard Tran Mills 423edb0b5bSRichard Tran Mills # Flags for the Cray compilers: 433edb0b5bSRichard Tran Mills# '--COPTFLAGS=-g -hcpu=mic-knl' 443edb0b5bSRichard Tran Mills# '--CXXOPTFLAGS=-g -hcpu=mic-knl' 453edb0b5bSRichard Tran Mills# '--FOPTFLAGS=-g -hcpu=mic-knl' 463edb0b5bSRichard Tran Mills 473edb0b5bSRichard Tran Mills # Flags for the GCC compilers: 483edb0b5bSRichard Tran Mills# '--COPTFLAGS=-g -march=knl -O3 -mavx512f -mavx512cd -mavx512er -mavx512pf', 493edb0b5bSRichard Tran Mills# '--CXXOPTFLAGS=-g -march=knl -O3 -mavx512f -mavx512cd -mavx512er -mavx512pf', 503edb0b5bSRichard Tran Mills# '--FOPTFLAGS=-g -march=knl -O3 -mavx512f -mavx512cd -mavx512er -mavx512pf', 513edb0b5bSRichard Tran Mills 523edb0b5bSRichard Tran Mills '--with-debugging=no', 533edb0b5bSRichard Tran Mills '--with-memalign=64', 549da85933SRichard Tran Mills '--with-mpiexec=srun', # Some systems (e.g., ALCF Theta) use '--with-mpiexec=aprun' instead. 553edb0b5bSRichard Tran Mills '--known-mpi-shared-libraries=1', 563edb0b5bSRichard Tran Mills '--with-clib-autodetect=0', 573edb0b5bSRichard Tran Mills '--with-fortranlib-autodetect=0', 583edb0b5bSRichard Tran Mills '--with-cxxlib-autodetect=0', 593edb0b5bSRichard Tran Mills '--LIBS=-lstdc++', 603edb0b5bSRichard Tran Mills '--LDFLAGS=-dynamic', # Needed if wish to use dynamic shared libraries. 613edb0b5bSRichard Tran Mills 623edb0b5bSRichard Tran Mills # Below "--known-" options are from the "reconfigure.py" script generated 633edb0b5bSRichard Tran Mills # after an intial configure.py run using '--with-batch'. 643edb0b5bSRichard Tran Mills '--known-level1-dcache-size=32768', 653edb0b5bSRichard Tran Mills '--known-level1-dcache-linesize=64', 663edb0b5bSRichard Tran Mills '--known-level1-dcache-assoc=8', 673edb0b5bSRichard Tran Mills '--known-sizeof-char=1', 683edb0b5bSRichard Tran Mills '--known-sizeof-void-p=8', 693edb0b5bSRichard Tran Mills '--known-sizeof-short=2', 703edb0b5bSRichard Tran Mills '--known-sizeof-int=4', 713edb0b5bSRichard Tran Mills '--known-sizeof-long=8', 723edb0b5bSRichard Tran Mills '--known-sizeof-long-long=8', 733edb0b5bSRichard Tran Mills '--known-sizeof-float=4', 743edb0b5bSRichard Tran Mills '--known-sizeof-double=8', 753edb0b5bSRichard Tran Mills '--known-sizeof-size_t=8', 763edb0b5bSRichard Tran Mills '--known-bits-per-byte=8', 773edb0b5bSRichard Tran Mills '--known-memcmp-ok=1', 783edb0b5bSRichard Tran Mills '--known-sizeof-MPI_Comm=4', 793edb0b5bSRichard Tran Mills '--known-sizeof-MPI_Fint=4', 803edb0b5bSRichard Tran Mills '--known-mpi-long-double=1', 813edb0b5bSRichard Tran Mills '--known-mpi-int64_t=1', 823edb0b5bSRichard Tran Mills '--known-mpi-c-double-complex=1', 833edb0b5bSRichard Tran Mills '--known-sdot-returns-double=0', 843edb0b5bSRichard Tran Mills '--known-snrm2-returns-double=0', 853edb0b5bSRichard Tran Mills '--known-has-attribute-aligned=1', 863edb0b5bSRichard Tran Mills '--with-batch=1', 873edb0b5bSRichard Tran Mills ] 883edb0b5bSRichard Tran Mills configure.petsc_configure(configure_options) 89