Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DedalusProject/dedalus_conda/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The Dedalus build scripts provide flexible MPI (Message Passing Interface) configuration options. You can either install OpenMPI from conda-forge or link to a custom system MPI installation.

Configuration Options

INSTALL_MPI

INSTALL_MPI
integer
default:"1"
Controls whether to install OpenMPI from conda-forge.Valid values:
  • 1 - Install OpenMPI from conda-forge (default)
  • 0 - Use custom MPI installation (requires MPI_PATH)

MPI_PATH

MPI_PATH
string
required
Path to your custom MPI installation prefix.Must be set when INSTALL_MPI=0. The build script will look for MPI binaries in ${MPI_PATH}/bin.

Installation Modes

The default configuration installs OpenMPI from conda-forge along with the required compilers and mpi4py.
# Default configuration
INSTALL_MPI=1
This mode:
  • Installs conda-forge compilers
  • Installs OpenMPI and openmpi-mpicc
  • Installs mpi4py from conda
  • Works seamlessly with conda-installed FFTW and HDF5

Build Behavior

With INSTALL_MPI=1

From the build script:
conda_install_dedalus3.sh
if [ ${INSTALL_MPI} -eq 1 ]
then
    echo "Installing conda-forge compilers, openmpi, mpi4py"
    conda install "${CARGS[@]}" compilers openmpi openmpi-mpicc mpi4py
The script installs:
  • compilers - Conda-forge compiler toolchain
  • openmpi - OpenMPI library
  • openmpi-mpicc - MPI C compiler wrapper
  • mpi4py - Python MPI bindings

With INSTALL_MPI=0

From the build script:
conda_install_dedalus3.sh
else
    echo "Not installing openmpi"
    echo "Installing mpi4py with pip"
    # Make sure mpicc will appear on path
    export PATH=${MPI_PATH}/bin:${PATH}
    echo "which mpicc: `which mpicc`"
    # no-cache to avoid wheels from previous pip installs
    python3 -m pip install --no-cache mpi4py
fi
The script:
  1. Adds your custom MPI binaries to PATH
  2. Verifies mpicc is accessible
  3. Builds mpi4py from source against your custom MPI

Validation

The build script validates MPI configuration before proceeding:
conda_install_dedalus3.sh
if [ ${INSTALL_MPI} -ne 1 ]
then
    if [ -z ${MPI_PATH} ]
    then
        >&2 echo "ERROR: MPI_PATH must be set"
        exit 1
    else
        echo "MPI_PATH set to '${MPI_PATH}'"
    fi
fi
When INSTALL_MPI=0, you must set MPI_PATH or the build will fail with an error.

Platform Considerations

HPC Clusters

On HPC systems, you typically want to use the system-provided MPI:
# Example for SLURM cluster with module system
module load openmpi/4.1.4

# Set in build script
INSTALL_MPI=0
export MPI_PATH="/opt/hpc/openmpi/4.1.4"

Workstations and Laptops

For local development, the conda-forge OpenMPI is recommended:
# Default - simplest option
INSTALL_MPI=1

Compatibility with FFTW

FFFTW from conda-forge is built for OpenMPI. If you use a custom MPI that is not OpenMPI-compatible, you may need to also use a custom FFTW build.From the build script comments:
# Note: FFTW from conda will likely only work with custom MPIs that are OpenMPI

Common Patterns

# Install everything from conda-forge
INSTALL_MPI=1
INSTALL_FFTW=1
INSTALL_HDF5=1

Build docs developers (and LLMs) love