Configuring Dedalus

Various aspects of the underlying numerics, logging behavior, and output behavior of Dedalus can be modified through a configuration interface using Python’s standard-library ConfigParser structure.

A dedalus.cfg file with the default configuration and descriptions of each option is included in the package. This file can be copied to any working directory with the command python3 -m dedalus get_config. The configuration settings can be modified by, in order of increasing precedence:

  1. Modifying the package’s dedalus.cfg file (not recommended).

  2. Creating a user-based config file at ~/.dedalus/dedalus.cfg.

  3. Creating a local config file called dedalus.cfg in the directory where you execute a Dedalus script.

  4. Modifying configuration values at the top of a Dedalus script like:

from dedalus.tools.config import config
config['logging']['stdout_level'] = 'debug'

The default configuration file in this version of Dedalus is copied below for reference:

#
# This file contains the default configuration options for Dedalus.
# Copy and modify this file to your own liking.
#
# Dedalus will examine the following locations for configuration files,
# from lowest to highest precedence:
#
#   1) The default in-package location:     dedalus/dedalus.cfg
#   2) Your home directory:                 ~/.dedalus/dedalus.cfg
#   3) The current working directory:       ./dedalus.cfg
#

[logging]

    # Available levels (in increasing priority):
    #   {debug, info, warning, error, critical}

    # Log level for (rank > 0) processes
    nonroot_level = warning

    # Log level for stdout handler
    # Use 'none' to specify no streamhandler
    stdout_level = info

    # Log level for file handler
    # Use 'none' to specify no filehandler
    file_level = none

    # Log filename base (will be expanded to <filename>_p0.log, etc)
    filename = logs/dedalus

[transforms]

    # Default transform library (scipy, fftw)
    DEFAULT_LIBRARY = fftw

    # Transform multiple fields together when possible
    GROUP_TRANSFORMS = False

[transforms-fftw]

    # FFTW transform planning rigor (estimate, measure, patient, exhaustive)
    PLANNING_RIGOR = measure

[parallelism]

    # Default transpose library (fftw, mpi)
    TRANSPOSE_LIBRARY = fftw

    # Place MPI Barriers before each transpose call
    SYNC_TRANSPOSES = False

    # Transpose multiple fields together when possible
    GROUP_TRANSPOSES = True

[parallelism-fftw]

    # Perform FFTW transposes in-place
    IN_PLACE = False

    # FFTW transpose planning rigor (estimate, measure, patient, exhaustive)
    PLANNING_RIGOR = measure

[parallelism-mpi]

    # Use variable-length all-to-all routine
    ALLTOALLV = False

[matrix construction]

    # Dirichlet preconditioning default
    # Set to True when not using a *FactorizedTranspose solver
    DIRICHLET_PRECONDITIONING = False

    # Put BC rows at the top of the matrix
    # Set to True when using Dirichlet preconditioning
    BC_TOP = False

    # Interleave subbasis modes
    # Set to True when using Dirichlet preconditioning
    INTERLEAVE_SUBBASES = False

    # Store expanded LHS matrices
    # Setting to True may speed up matrix factorization at the expense of extra memory
    STORE_EXPANDED_MATRICES = True

[linear algebra]

    # Default sparse matrix solver for single solves
    MATRIX_SOLVER = SuperLUNaturalSpsolve

    # Default sparse matrix factorizer for repeated solves
    MATRIX_FACTORIZER = SuperLUNaturalFactorizedTranspose

[memory]

    # Preallocate output fields for all operators
    # Setting to True may speed up operator evaluation at the expense of extra memory
    PREALLOCATE_OUTPUTS = False

[analysis]

    # Default filehandler mode (overwrite, append)
    FILEHANDLER_MODE_DEFAULT = overwrite

    # Default filehandler parallel setting
    FILEHANDLER_PARALLEL_DEFAULT = False

    # Force filehandlers to touch a tmp file on each node.
    # Setting to True may help work around e.g. NFS caching issues
    FILEHANDLER_TOUCH_TMPFILE = False