#! /bin/csh -f

#===============================================================================
# Hexagon machine specific settings
#===============================================================================

#-------------------------------------------------------------------------------
# Modules
#-------------------------------------------------------------------------------

if (-e /usr/share/modules/init/csh) then
  source /usr/share/modules/init/csh
  module unload intelcomp mpt netcdf
  module load intelcomp/15.0.1
  module load mpt/2.10
  module load netcdf/4.3.2
endif

#-------------------------------------------------------------------------------
# Runtime environment variables
#-------------------------------------------------------------------------------

setenv MPICH_MAX_SHORT_MSG_SIZE 960000 # default is 128000 bytes
setenv MPICH_PTL_UNEX_EVENTS     90000 # default is  90000 (unexpected recv queue size)
setenv MPICH_UNEX_BUFFER_SIZE     600M # default is    60M (unexpected short msgs buff size)
setenv MPICH_MSGS_PER_PROC      160000 # default is  32768
setenv MPICH_PTL_SEND_CREDITS       -1

setenv MPICH_ENV_DISPLAY 1
setenv MPICH_VERSION_DISPLAY 1

# These environment variables were suggested by Helen He to help get around compiler issues
# with pgi9
setenv MALLOC_MMAP_MAX_ 0
setenv MALLOC_TRIM_THRESHOLD_ 536870912

# The environment variables below produce corefiles and maybe (?) should be
# moved to DEBUG mode at some point
setenv MPICH_DBMASK 0x200
setenv decfort_dump_flag Y
limit coredumpsize unlimited

# The environment variable below increase the stack size, which is necessary for
# CICE to run threaded on this machine.  
setenv KMP_STACKSIZE 64M
