Description
Dedalus is a framework for solving partial differential equations using pseudo-spectral methods. The code is open source and has historically been very well maintained by an active community of researchers. Dedalus is written primarily in Python and uses friendly symbolic equation entry for model design which allows for fast prototyping and design. It is parallelized for MPI.
Individuals interested in understanding spectral and pseudospectral methods in more detail should consult "Chebyshev and Fourier Spectral Methods" by J.P. Boyd, and "Spectral Methods in MATLAB" by Lloyd N. Trefethen. The documentation provided by the Dedalus team is also a good first resource for understanding how to use the package.
Installation
As of writing, DedalusV2 is the primary version and can be installed using this dedalus-spec.txt file.
Download that file and copy it to your account on any MFCF Linux research server, then run these commands:
-
module load anaconda
-
conda env create --name dedalusv2 --file ~/dedalus-spec.txt
-
conda activate dedalusv2
-
conda env config vars set OMP_NUM_THREADS=1
-
conda env config vars set NUMEXPR_MAX_THREADS=1
Verify
the
Anaconda
environment
installation
by
running
python
-m
dedalus
test
.
There
should
be
no
failed
tests;
however,
'xfailed'
and
'warning'
are
fine.
At this point you are ready to begin exploring Dedalus. You are also free to modify the Anaconda environment as you see fit by installing other Python packages using conda. In the event that some packages conflict with Dedalus, or things stop working for some other reason, you can uninstall them individually, or you can completely rebuild the environment by running
-
conda deactivate
-
conda env remove --name dedalusv2
before repeating the installation steps.
Using the environment
-
ensure
anaconda
module
is
loaded:
module load anaconda
-
activate
dedalusv2
environment:
conda activate dedalusv2
-
your
shell
prompt
should
now
look
like
this,
for
your
userid
and
whichever
CPU
server
you
are
on:
(dedalusv2) userid@cpuNNN
-
to
exit
the
dedalusv2
environment:
conda deactivate
Examples
The following example files show an example procedure for completing a full problem in Dedalus. They show how to solve a non-linear initial value problem with or without multithreading, store the results using the HDF5 file format commonly used in high performance computing, as well as construct a virtual dataset. Finally, the virtual dataset is used to generate a couple of figures.
- dedalus_example.txt
- build_vds.txt
- plots_from_vds.txt
- the WCMS doesn't allow a .py filename suffix, so rename these Python code files from .txt to .py after you download them
Getting help
Dedalus utilizes h5py to store long simulations. The HDF5 data format lets you store large amounts of data and manipulate it utilizing NumPy-style syntax. Becoming familiar with this framework through their examples will help with long simulations.
- There are several Jupyter notebooks available on the Dedalus tutorial page.
- The Dedalus user group is very active in supporting new and continuing users alike.