#!/bin/bash 
# Settings for the Stampede system at the Texas Advanced Computing Center.
#
# This configuration file needs to be explicitly pointed to by the
# option -H or --host-id since the hostname changes with each login.
#
# $Id$

#%include compilers/Intel_MPI
#%include compilers/extensions/Intel_optimal

%section Makefile
  #FC=/opt/intel/compilers_and_libraries_2018.0.128/linux/mpi/intel64/bin/mpif90
  FC=/opt/apps/intel18/impi/18.0.2/bin/mpif90
  #CC=/opt/intel/compilers_and_libraries_2018.0.128/linux/mpi/intel64/bin/mpicc
  #CC=/opt/intel/compilers_and_libraries_2017.4.196/linux/mpi/intel64/bin/mpicc
  CC=/opt/apps/intel18/impi/18.0.2/bin/mpicc
  FFLAGS=-O3
  CFLAGS=-DFUNDERSC=1

  ############ Processor architecture specific optimization ############
  # uncomment the relevant section to enable optimizations for intel compiler:

  # MIC-AVX512 architcture optimization; will run ONLY on KNL nodes (normal, development, large queues on Stampede 2)
  FFLAGS += -xCORE-AVX2 -axCORE-AVX512,MIC-AVX512
  CFLAGS += -xCORE-AVX2 -axCORE-AVX512,MIC-AVX512

  # CORE-AVX512 architcture optimization; will run ONLY on SKX nodes (skx-normal, skx-dev, skx-large queues on Stampede 2)
  #FFLAGS += -xCORE-AVX512
  #CFLAGS += -xCORE-AVX512

  # multiple cpu dispatch, will take slightly longer to compile; binaries will be slightly larger, and will run slightly
  # slower than single-architecture optimized compilation, but will run on either kind of node
  #FFLAGS += -xCORE-AVX2 -axCORE-AVX512,MIC-AVX512
  #CFLAGS += -xCORE-AVX2 -axCORE-AVX512,MIC-AVX512
  ######################################################################
  FFLAGS_DOUBLE = -autodouble
  CFLAGS_DOUBLE = -DDOUBLE_PRECISION
%endsection Makefile

%section runtime
  #mpiexec = /opt/apps/xalt/0.6/bin/ibrun
  mpiexec=/usr/local/bin/ibrun
  mpiexec_opts =              # options before `-n $ncpus'
%endsection runtime