README.md 14.8 KB
Newer Older
Dion Haefner's avatar
Dion Haefner committed
1 2 3
# Welcome to DORiE!
(__D__UNE-__O__perated __Ri__chards equation solving __E__nvironment)

4
[![build status](https://zwackelmann.iup.uni-heidelberg.de:10443/dorie/dorie/badges/master/build.svg)](https://zwackelmann.iup.uni-heidelberg.de:10443/dorie/dorie/commits/master)
Dion Haefner's avatar
Dion Haefner committed
5

6
DORiE is a software suite for solving Richard's Equation. The core feature is a C++ PDE-solver powered by [DUNE](https://dune-project.org/) and the [DUNE-PDELab](https://dune-project.org/modules/dune-pdelab/) module. It implements a Discontinous Galerkin (DG) discretization scheme on structured rectangular / cubic and unstructured simplex grids in two and three spatial dimensions, and makes use of advanced features like adaptive grid refinement.
7 8 9

The suite encapsulates a documentation and various tools for program setup, program testing, and output analysis, which are mostly written in Python.

10
DORiE is developed and maintained by the [DORiE Developers](mailto:dorieteam@iup.uni-heidelberg.de) of the [TS-CCEES](http://ts.iup.uni-heidelberg.de/) research group at [IUP Heidelberg](http://www.iup.uni-heidelberg.de/), supervised by [Kurt Roth](http://ts.iup.uni-heidelberg.de/people/prof-dr-kurt-roth/), in collaboration with [Ole Klein](https://conan.iwr.uni-heidelberg.de/people/oklein/) and the [Scientific Computing Group](https://conan.iwr.uni-heidelberg.de/) of [IWR Heidelberg](https://typo.iwr.uni-heidelberg.de/home/). 
11 12 13 14


# Installation Instructions

Dion Haefner's avatar
Dion Haefner committed
15
DORiE is a [DUNE](https://dune-project.org/) module and requires several other DUNE modules as well as third party software packages. Installation can be handled manually on your local machine, but for inexperienced users it is recommended to use the deployment software [Docker](https://www.docker.com/) instead.
16

Dion Haefner's avatar
Dion Haefner committed
17
In any case, DORiE is configured, built, and installed via the [DUNE Buildsystem](https://dune-project.org/doc/installation/), using the `dunecontrol` script to handle DUNE-internal dependencies.
18

19 20 21 22 23 24 25 26 27
## Docker Installation - Simple Setup
This setup is intended for users who simply want to start computations with DORiE.

Install Docker on your machine. Then, use `git clone` to download the DORiE repository into a suitable directory on your machine. Enter the directory, and call

    docker build -t dorie .

Docker will use a prepared image from Dockerhub and install DORiE into it. You can now call DORiE via the Docker deamon from any directory `dir` on your machine:

Dion Häfner's avatar
Dion Häfner committed
28
    docker run -i -t -v <dir>:/sim dorie <command>
29 30 31

The `-v` option tells docker to mount the directory into the container work directory (`sim`).

Dion Häfner's avatar
Dion Häfner committed
32
In the section 'Usage' you will find a list of possible commands. Note that input and output files can only be placed in the `<dir>` directory or subdirectories thereof. You must use relative paths in the DORiE configuration files.
33 34

## Docker Installation - Interactive Setup
Dion Häfner's avatar
Dion Häfner committed
35
This setup is intended for advanced users. You will gain access to the DORiE module outside the container, and be able to make changes to the source code.
36

37
We have prepared a [DORiE DUNE Environment Image on Dockerhub](https://hub.docker.com/r/dorie/dune-env/), which is a modified image of the Ubuntu OS that has all dependencies readily installed. The current version is 2.5.1 (referencing the DUNE module version 2.5). We will run a new container from this image and mount some local directory `<hostdir>/dorie` into it by calling
38

39
    docker run -v <hostdir>/dorie:/opt/dune/dorie -i -t dorie/dune-env:2.5.1 /bin/bash
40

Lukas Riedel's avatar
Lukas Riedel committed
41
Docker will automatically download the image if necessary. Now you can access the content of the (still empty) folder of the virtual machine from your local `<hostdir>/dorie` directory. *Mounting directories is not possible after your container has been started!*
42

Lukas Riedel's avatar
Lukas Riedel committed
43
Next, use `git clone` to download the DORiE repository into the shared (mounted) folder. Enter the container, and execute
44 45

    dunecontrol --only=dorie all
46 47 48 49
    
to build DORiE, or

    MAKE_FLAGS="-j <N>" dunecontrol --only=dorie all
50

51
to build in parallel on `N` processes. Lastly, install the DORiE binaries by calling
52 53

    dunecontrol --only=dorie make install
54

55
### Update DUNE
Lukas Riedel's avatar
Lukas Riedel committed
56
The DUNE modules (as well as DORiE itself) in the repository might be outdated. You can update to the newest versions by calling
57 58 59

    dunecontrol update

60
Then compile and install all modules again by executing
61

62
    dunecontrol all && dunecontrol make install
63

Dion Haefner's avatar
Dion Haefner committed
64

65
## Manual Installation
Dion Häfner's avatar
Dion Häfner committed
66 67 68
Installing all packages manually can be quite an effort, but useful for developers who want to have easy access to the source files or users who prefer to run DORiE without the Docker overhead. 

Whenever possible, dependencies should be installed using a package manager, like [APT](https://wiki.ubuntuusers.de/APT/) on Ubuntu or [Homebrew](http://brew.sh/) on Mac. Manual installation on a Windows environment is strongly discouraged!
69 70

### Dependencies
Dion Haefner's avatar
Dion Haefner committed
71
Depending on your system configuration, there will be more packages necessary to install DORiE on your machine. See the step-by-step manual for further details.
72 73 74

| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
Dion Haefner's avatar
Dion Haefner committed
75
| CMake | >= 2.8.12 |
76 77 78
| GCC | >= 5 |
| git |
| pkg-config |
Dion Haefner's avatar
Dion Haefner committed
79 80
| HDF5 | | with MPI support
| FFTW3 | | with MPI support
81 82
| Python | 3.x |
| pip | 3.x |
83
| MPI | | Tested with OpenMPI
Dion Haefner's avatar
Dion Haefner committed
84
| SuperLU | 4.3 or 5.x |
85 86 87
| [dune-common](https://gitlab.dune-project.org/core/dune-common) | releases/2.5
| [dune-geometry](https://gitlab.dune-project.org/core/dune-geometry) | releases/2.5
| [dune-grid](https://gitlab.dune-project.org/core/dune-grid) | releases/2.5
88
| [dune-uggrid](https://gitlab.dune-project.org/staging/dune-uggrid) | releases/2.5
89 90
| [dune-istl](https://gitlab.dune-project.org/core/dune-istl) | releases/2.5
| [dune-localfunctions](https://gitlab.dune-project.org/core/dune-localfunctions) | releases/2.5
91
| [dune-functions](https://gitlab.dune-project.org/staging/dune-functions) | releases/2.5
92
| [dune-typetree](https://gitlab.dune-project.org/staging/dune-typetree) | releases/2.5
93
| [dune-pdelab](https://gitlab.dune-project.org/pdelab/dune-pdelab) | releases/2.5
Lukas Riedel's avatar
Lukas Riedel committed
94 95 96 97 98


### Optional Packages
| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
99
| [dune-testtools](https://gitlab.dune-project.org/quality/dune-testtools) | master | Handles system tests
Lukas Riedel's avatar
Lukas Riedel committed
100 101 102
| [doxygen](http://www.stack.nl/~dimitri/doxygen/) | | Builds documentation
| [METIS](http://glaros.dtc.umn.edu/gkhome/views/metis) | 5 | For parallel runs
| [ParMETIS](http://glaros.dtc.umn.edu/gkhome/views/metis) | 4 | For parallel runs
103 104


105
### Step-by-step Instructions
106 107
These instructions are suitable for a clean **Ubuntu** or **Mac OS X** setup. The main difference between the two systems is the package manager. Debian-based systems have the APT manager already built in. On Mac, we recommend installing [Homebrew](http://brew.sh/). If you prefer to use [MacPorts](https://www.macports.org/), you need to check if some of the packages require different installation options than displayed here.

108 109
If you installed [Anaconda](https://conda.io/docs/user-guide/install/download.html) on your machine, you don't need to install Python or Pip. Simply skip these packages when using the package managers for installing the software. However, notice the warnings when compiling DORiE below!

110 111 112
1. **Mac OS X** users need to start by installing the Apple Command Line Tools by executing

        xcode-select --install
Dion Haefner's avatar
Dion Haefner committed
113 114

1. Install third party packages:
Lukas Riedel's avatar
Lukas Riedel committed
115
    
116
    **Ubuntu:**
Dion Haefner's avatar
Dion Haefner committed
117
    
Dion Haefner's avatar
Dion Haefner committed
118
        apt update 
119
        apt install cmake doxygen gcc-5 g++-5 gfortran-5 \
Dion Haefner's avatar
Dion Haefner committed
120 121
                    git libatlas-base-dev libfftw3-dev libfftw3-mpi-dev \
                    libfreetype6-dev libhdf5-mpi-dev libopenmpi-dev libpng-dev \
122
                    libsuperlu-dev libxft-dev python3-dev python3-pip
123

124 125 126
    **Mac OS X:**

        brew update
Lukas Riedel's avatar
Lukas Riedel committed
127
        brew install cmake doxygen gcc libpng open-mpi \
128
                    pkg-config python3 superlu
129 130 131
        brew install hdf5 --with-mpi
        brew install fftw --with-mpi

Lukas Riedel's avatar
Lukas Riedel committed
132 133 134 135
1. The parallel linear solver of DORiE can make use of the ParMETIS package. If you want to run DORiE in parallel on multiple processes, additionally install METIS and ParMETIS:

    **Ubuntu:**

136
        apt install libmetis-dev libparmetis-dev
Lukas Riedel's avatar
Lukas Riedel committed
137

138
    **Mac OS X:** _Support is dropped because ParMETIS is currently unavailable from Homebrew._
Lukas Riedel's avatar
Lukas Riedel committed
139 140 141

    **Parallel runs without these two packages are possible but not supported!**

142
3. **Mac OS X** only: 
Lukas Riedel's avatar
Lukas Riedel committed
143
    The Apple Clang compiler shipped with CMake is not suitable for compiling DORiE. Before proceeding, call
144

Lukas Riedel's avatar
Lukas Riedel committed
145 146
        export CC=gcc-7
        export CXX=g++-7
147

148
    to enfore the Homebrew'd GCC compiler. Note that this variable export only lasts for your current terminal session. Always make sure that the configuration tool actually finds GCC instead of the Apple Clang.
149

150 151 152
4. Clone the DUNE modules and DORiE into a suitable folder on your machine. Use `git checkout` to switch to the correct branches (see above). Enter the parent folder, and call

        CMAKE_FLAGS="-DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" ./dune-common/bin/dunecontrol all
153

154
    to build all DUNE modules. Additionally, you can add `MAKE_FLAGS="-j X"` before the call to `dunecontrol` to compile on `X` processes in parallel.
155

156
    If you installed software into paths not appended to your `PATH` variable, you will have to add `CMAKE_FLAGS` to the call to make sure that CMake finds all packages. Alternatively, you can add a custom options file. See the [DUNE Installation Instructions](https://dune-project.org/doc/installation/) for details. CMake will throw an error if required packages are not found.
157 158 159 160 161 162

    **Warning:** Anacoda supplies its own version of HDF5 which is typically found first by CMake. If you have Anaconda installed on your machine, add

        `HDF5_ROOT=/usr/local`

    to the `CMAKE_FLAGS` in the call to `dunecontrol` above.
Dion Haefner's avatar
Dion Haefner committed
163
 
Lukas Riedel's avatar
Lukas Riedel committed
164
5. After a successful build you can call the `dorie` wrapper located in `dorie/build-cmake/bin` from anywhere on your machine, but it is more handy to add this location to your search path. You can add the directory to your `PATH` variable by calling
165

Lukas Riedel's avatar
Lukas Riedel committed
166
        PATH=<path/to/>dorie/build-cmake/bin:$PATH
167

Lukas Riedel's avatar
Lukas Riedel committed
168 169 170
    However, this will only last for your current terminal session. Another option is to add this path permanently in your shell configuration file.

    **Installing DUNE and DORiE via `make install` into your usual work environment is strongly discouraged!**
171

172

173 174 175
## Recommended Third-Party Software

The following software packages are cross-platform, so you should be able to find a release that fits your operating system:
Dion Haefner's avatar
Dion Haefner committed
176 177 178 179

* [Gmsh](http://gmsh.info/): An open-source CAD that can be used to create the `.msh` files used by DORiE to define triangular meshes.
* [ParaView](http://www.paraview.org/): A powerful post-processing tool for VTK files. Offers both visualization and data analysis tools.

180
# Usage
Dion Haefner's avatar
Dion Haefner committed
181

182 183
## Start an interactive Docker session

184
In case you built DORiE using `docker build` and want to start an interactive session, e.g. to build the documentation or do some debugging, you can do so by specifying a custom entrypoint for the container:
185 186 187 188 189

    docker run -i -t --entrypoint=/bin/bash -v <dir>:/sim dorie

This way, an interactive bash session inside the container will be started (instead of directly running DORiE). Note that DUNE and DORiE are located in `/opt/dune`.

190
## Documentation
Dion Haefner's avatar
Dion Haefner committed
191

192
The documentation of the current `master` branch can be found [online](http://dorie-docs.gitballoon.com) (password: `richards`).
Dion Haefner's avatar
Dion Haefner committed
193

194
The documentation can be built after DORiE has been properly configured (i.e., by calling `dunecontrol`). Note that you might have to re-configure DORiE once after installing it, because some dependencies are installed at configure time (e.g. by `dunecontrol --only=dorie configure`). To build the documentation, just run
Dion Haefner's avatar
Dion Haefner committed
195

Dion Haefner's avatar
Dion Haefner committed
196
    dunecontrol --only=dorie make doc
Dion Haefner's avatar
Dion Haefner committed
197

Lukas Riedel's avatar
Lukas Riedel committed
198 199 200 201
or navigate to the `dorie/build-cmake` directory and call

    make doc

202
The documentation files can now be found in the subfolder `dorie/build-cmake/doc`.
Dion Haefner's avatar
Dion Haefner committed
203

204
## Run, DORiE, Run!
Lukas Riedel's avatar
Lukas Riedel committed
205
If you made the DORiE wrapper directory available through your `PATH` variable, you can call it by simply executing
206 207

    dorie <command>
208

Lukas Riedel's avatar
Lukas Riedel committed
209 210 211
You can always find the wrapper in the `dorie/build-cmake/bin` folder of your installation and call it directly with

    <path/to/>dorie/build-cmake/bin/dorie <command>
212

213
To start your first simulation run, create a new directory and enter it. Place some exemplary configuration and boundary condition data files in there by calling
214 215 216

    dorie create

217 218
DORiE encapsulates two routines, the Parameter Field Generator (PFG) and the main program routine. Each takes a single `.ini` configuration file as arguments.

219 220
Tweak the paramters to your liking and then call

221 222 223 224
    dorie pfg <inifile>

to create a parameter field file. Make sure that you instruct the main routine to call the file you just created. Then call

225
    dorie run <inifile>
Dion Haefner's avatar
Dion Haefner committed
226

227
to execute the main program.
Dion Haefner's avatar
Dion Haefner committed
228

229
List all available commands and find further help by executing
Dion Haefner's avatar
Dion Haefner committed
230

Dion Häfner's avatar
Dion Häfner committed
231
    dorie --help
Dion Haefner's avatar
Dion Haefner committed
232

233 234
or

Dion Häfner's avatar
Dion Häfner committed
235
    dorie <command> --help
236

237
## Troubleshooting
Dion Haefner's avatar
Dion Haefner committed
238 239
CMake heavily caches the results of its configuration process. In case you encounter errors or strange behavior, especially after an update, you should delete the DORiE build folder (called `build-cmake` by default) and re-install DORiE using `dunecontrol`.

240
If the problem persists, take a look at the [List of Known Bugs](https://zwackelmann.iup.uni-heidelberg.de:10443/dorie/dorie/issues), or create an issue yourself. For problems related to the installation, refer to the sections below.
Dion Haefner's avatar
Dion Haefner committed
241

242
### Debugging
Dion Haefner's avatar
Dion Haefner committed
243
DORiE can be built with debugging flags via CMake. To do so, run
244

Dion Haefner's avatar
Dion Haefner committed
245
    CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Debug" dunecontrol --only=dorie all
246

Dion Haefner's avatar
Dion Haefner committed
247
After building, a debugger can hook into the executables.
248

Dion Haefner's avatar
Dion Haefner committed
249
**Note:** If no `CMAKE_BUILD_TYPE` is specified during re-configuration, the last configuration build type is used. If no CMake files exist, it defaults to `Release`. You will find the actual value displayed in the final output of CMake.
250

Dion Haefner's avatar
Dion Haefner committed
251
To re-create a release build, configure DORiE with the release build type by executing
252

Dion Haefner's avatar
Dion Haefner committed
253
    CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release" dunecontrol --only=dorie all
254

255 256 257 258 259
#### Debugging inside Docker
A debugger needs special security privileges usually not provided by the Docker engine. To enable debugging inside Docker, these privileges have to be granted when calling `docker run` by adding the options

    --security-opt seccomp=unconfined

Dion Häfner's avatar
Dion Häfner committed
260
The debugger `gdb` is pre-installed in the Docker container.
261

Dion Haefner's avatar
Dion Haefner committed
262
### DORiE is running, but I suspect that something is wrong
Dion Haefner's avatar
Dion Haefner committed
263
You can execute system tests in order to ensure that DORiE is running correctly and producing the expected results:
Dion Haefner's avatar
Dion Haefner committed
264

Dion Haefner's avatar
Dion Haefner committed
265
    ARGS="--output-on-failure" dunecontrol --only=dorie make test
Dion Haefner's avatar
Dion Haefner committed
266 267 268

You will be informed whether each test has been passed or failed, and you may find additional output in the DORiE build directory.

269
### Further Help
270
[Open an issue](https://zwackelmann.iup.uni-heidelberg.de:10443/dorie/dorie/issues/new), or write to the [DORiE developer mailing list](mailto:dorieteam@iup.uni-heidelberg.de).