Skip to content

Commit

Permalink
Merge pull request #380 from opesci/dask2
Browse files Browse the repository at this point in the history
Added draft of devito dask FWI tutorial
  • Loading branch information
Michael Lange authored Oct 28, 2017
2 parents 0644ec1 + a962b0d commit 774a0a0
Show file tree
Hide file tree
Showing 5 changed files with 681 additions and 7 deletions.
15 changes: 8 additions & 7 deletions devito/compiler.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from functools import partial
from hashlib import sha1
from os import environ, getuid, mkdir, path
from tempfile import gettempdir
from os import environ, path
from tempfile import mkdtemp
from time import time
from sys import platform
import subprocess
Expand Down Expand Up @@ -194,12 +194,13 @@ def get_tmp_dir():
:return: Path to a devito-specific tmp directory
"""
tmpdir = path.join(gettempdir(), "devito-%s" % getuid())
global _devito_compiler_tmpdir
try:
path.exists(_devito_compiler_tmpdir)
except:
_devito_compiler_tmpdir = mkdtemp(prefix="devito-")

if not path.exists(tmpdir):
mkdir(tmpdir)

return tmpdir
return _devito_compiler_tmpdir


def load(basename, compiler):
Expand Down
2 changes: 2 additions & 0 deletions docs/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ inversion problems.
<http://nbviewer.jupyter.org/github/opesci/devito/blob/master/examples/seismic/tutorials/02_rtm.ipynb>`_
* `03 - Full-Waveform Inversion (FWI)
<http://nbviewer.jupyter.org/github/opesci/devito/blob/master/examples/seismic/tutorials/03_fwi.ipynb>`_
* `04 - Parallel FWI with Dask
<http://nbviewer.jupyter.org/github/opesci/devito/blob/master/examples/seismic/tutorials/04_dask.ipynb>`_
3 changes: 3 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ dependencies:
- psutil>=5.1.0
- sphinx
- sphinx_rtd_theme
- dask
- distributed
- scikit-image
- pip:
- "git+https://github.com/inducer/codepy"
- py-cpuinfo
665 changes: 665 additions & 0 deletions examples/seismic/tutorials/04_dask.ipynb

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ psutil>=5.1.0
py-cpuinfo
git+https://github.com/inducer/cgen
git+https://github.com/inducer/codepy
dask
distributed
scikit-image

0 comments on commit 774a0a0

Please sign in to comment.