#-------------------------------------------------------------------------------
# Core Brian preferences
#-------------------------------------------------------------------------------

[core]

# Default dtype for all arrays of scalars (state variables, weights, etc.).'

default_scalar_dtype = float64

#-------------------------------------------------------------------------------
# Logging system preferences
#-------------------------------------------------------------------------------

[logging]

# What log level to use for the log written to the console.
# 
# Has to be one of CRITICAL, ERROR, WARNING, INFO or DEBUG.

console_log_level = 'WARNING'

# Whether to delete the log and script file on exit.
# 
# If set to ``True`` (the default), log files (and the copy of the main
# script) will be deleted after the brian process has exited, unless an
# uncaught exception occured. If set to ``False``, all log files will be kept.

delete_log_on_exit = True

# Whether to log to a file or not.
# 
# If set to ``True`` (the default), logging information will be written
# to a file. The log level can be set via the `logging.file_log_level`
# preference.

file_log = True

# What log level to use for the log written to the log file.
# 
# In case file logging is activated (see `logging.file_log`), which log
# level should be used for logging. Has to be one of CRITICAL, ERROR,
# WARNING, INFO or DEBUG.

file_log_level = 'DEBUG'

# Whether to save a copy of the script that is run.
# 
# If set to ``True`` (the default), a copy of the currently run script
# is saved to a temporary location. It is deleted after a successful
# run (unless `logging.delete_log_on_exit` is ``False``) but is kept after
# an uncaught exception occured. This can be helpful for debugging,
# in particular when several simulations are running in parallel.

save_script = True

#-------------------------------------------------------------------------------
# Numpy runtime codegen preferences
#-------------------------------------------------------------------------------

[codegen.runtime.numpy]

# Whether to change the namespace of user-specifed functions to remove
# units.

discard_units = False

#-------------------------------------------------------------------------------
# Weave runtime codegen preferences
#-------------------------------------------------------------------------------

[codegen.runtime.weave]

# Compiler to use for weave.

compiler = 'gcc'

# Extra compile arguments to pass to compiler

extra_compile_args = ['-w', '-O3', '-ffast-math']

# Include directories to use.

include_dirs = []

#-------------------------------------------------------------------------------
# C++ codegen preferences
#-------------------------------------------------------------------------------

[codegen.languages.cpp]

# Adds code to flush denormals to zero.
# 
# The code is gcc and architecture specific, so may not compile on all
# platforms. The code, for reference is::
# 
#     #define CSR_FLUSH_TO_ZERO         (1 << 15)
#     unsigned csr = __builtin_ia32_stmxcsr();
#     csr |= CSR_FLUSH_TO_ZERO;
#     __builtin_ia32_ldmxcsr(csr);
#     
# Found at `<http://stackoverflow.com/questions/2487653/avoiding-denormal-values-in-c>`_.

flush_denormals = False

# The keyword used for the given compiler to declare pointers as restricted.
# 
# This keyword is different on different compilers, the default is for gcc.

restrict_keyword = '__restrict__'

#-------------------------------------------------------------------------------
# Code generation preferences
#-------------------------------------------------------------------------------

[codegen]

# Default target for code generation.
# 
# Can be a string, in which case it should be one of:
# 
# * `'numpy'` by default because this works on all platforms, but may not
#   be maximally efficient.
# * `'weave`' uses ``scipy.weave`` to generate and compile C++ code,
#   should work anywhere where ``gcc`` is installed and available at the
#   command line.
# 
# Or it can be a ``CodeObject`` class.

target = 'numpy'

