Welcome to the interactive hands-on tutorial for Devito. Devito is a domain-specific language (DSL) and code generation framework for the design of highly optimised finite difference kernels, and was primarily designed for use in seismic inversion methods. Devito utilises SymPy to allow the definition of matrix-free finite difference operators from high-level symbolic equations and generates optimised and automatically tuned code specific to a given target architecture.
This hands-on tutorial is intended to give you an initial flavour of the Devito framework and the power of symbolic computation. We will demonstrate how quickly explicit finite difference operators can be created from only a few lines of Python code, and how we can use them to implement complex imaging algorithms in very little time (literally!). For a more in-depth overview (and as cheat-sheet if you can speed read), you can find another set of tutorial notebooks on our webpage that go through the covered topics in more detail.
On entering the tutorial you should have been given an IP address for your own cloud instance that contains the full setup for this tutorial. To get started, you should log into this node and execute the following commands to start the Jupyter Notebook server:
cd devcon-tutorial
jupyter notebook
Once that is setup you should simply open the following in your browser:
http://<instance_ip>:9889
Now you should see a set of Jupyter notebooks, inlcuding this one called 00_index.ipynb
. The procedure is explained in more detail here.
Once the above installation step has finished, we should run a quick sanity check that we have everything that we need. The following cell should simply complete without any errors.
In [ ]:
from devito import *
from examples.seismic import model, source
For the final part of this tutorial we will have a quick look at the stencil compiler YASK, which is currently being integrated with Devito. To verify YASK works smoothly you can run:
In [ ]:
import yask
scipy.optimize
Session 1: Introduction to Devito
Session 2: Seismic Imaging
M. Lange, N. Kukreja, F. Luporini, M. Louboutin, C. Yount, J. Hückelheim and G. Gorman. Optimised finite difference computation from symbolic equations. Accepted for publication in Proceedings of the 15th Python in Science Conference, 2017. [doi:10.25080/shinma-7f4c6e7-00d] [arxiv]
M. Louboutin, M. Lange, N. Kukreja, F. Herrmann, and G. Gorman. Performance prediction of finite-difference solvers for different computer architectures. Accepted for publication in Computers & Geosciences, 2016, doi:10.1016/j.cageo.2017.04.014
This notebook is part of the tutorial "Optimised Symbolic Finite Difference Computation with Devito" presented at the Intel® HPC Developer Conference 2017.