Skip to content

Commit

Permalink
setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Nov 20, 2018
2 parents fdb434c + 59c70ab commit d89042e
Show file tree
Hide file tree
Showing 71 changed files with 2,374 additions and 970 deletions.
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ matrix:
packages:
- gcc-5
- g++-5
env: DEVITO_ARCH=gcc-5 DEVITO_OPENMP=0 RUN_EXAMPLES=True INSTALL_TYPE=conda MPI_INSTALL=1
env: DEVITO_ARCH=gcc-5 DEVITO_OPENMP=0 RUN_EXAMPLES=False INSTALL_TYPE=conda MPI_INSTALL=0
- os: linux
python: "3.6"
addons:
Expand All @@ -47,9 +47,9 @@ matrix:
sources:
- ubuntu-toolchain-r-test # For gcc 4.9, 5 and 7
packages:
- gcc-4.9
- g++-4.9
env: DEVITO_ARCH=gcc-4.9 DEVITO_OPENMP=1 OMP_NUM_THREADS=2 RUN_EXAMPLES=True INSTALL_TYPE=conda MPI_INSTALL=0
- gcc-7
- g++-7
env: DEVITO_ARCH=gcc-7 DEVITO_OPENMP=0 DEVITO_BACKEND=yask YC_CXX=g++-7 INSTALL_TYPE=conda RUN_EXAMPLES=False MPI_INSTALL=1
- os: linux
python: "3.6"
addons:
Expand All @@ -59,7 +59,7 @@ matrix:
packages:
- gcc-7
- g++-7
env: DEVITO_ARCH=gcc-7 DEVITO_OPENMP=0 DEVITO_BACKEND=yask YC_CXX=g++-7 INSTALL_TYPE=conda RUN_EXAMPLES=False MPI_INSTALL=1
env: DEVITO_ARCH=gcc-7 DEVITO_OPENMP=0 DEVITO_BACKEND=ops YC_CXX=g++-7 INSTALL_TYPE=conda RUN_EXAMPLES=False MPI_INSTALL=0
allow_failures:
- os: linux
python: "2.7"
Expand Down Expand Up @@ -87,14 +87,16 @@ before_install:
- conda update -q conda
# Useful for debugging any issues with conda
- conda info -a
- sudo apt-get install -y -q mpich libmpich-dev
- if [[ "$MPI_INSTALL" == '1' ]]; then
sudo apt-get install -y -q mpich libmpich-dev;
fi

install:
# Install devito with conda
- if [[ $INSTALL_TYPE == 'conda' ]]; then
conda env create -q -f environment.yml python=$TRAVIS_PYTHON_VERSION;
source activate devito;
pip install -e .;
if [[ $MPI_INSTALL == '1' ]]; then pip install -e .[extras]; else pip install -e .; fi
conda list;
fi
- if [[ "$MPI_INSTALL" == '1' ]]; then
Expand Down
32 changes: 30 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pipeline {
environment {
HOME="${WORKSPACE}"
DEVITO_OPENMP=0
INSTALL_MPI=1
PYTHONPATH="${WORKSPACE}/lib/python3.6/site-packages/"
}
steps {
Expand All @@ -27,13 +28,14 @@ pipeline {
runPipTests()
}
}
stage('Build and test gcc-4.9 OpenMP container') {
stage('Build and test gcc-4.9 OpenMP container no MPI') {
agent { dockerfile { label 'azure-linux-8core'
filename 'Dockerfile.jenkins'
additionalBuildArgs "--build-arg gccvers=4.9" } }
environment {
HOME="${WORKSPACE}"
DEVITO_OPENMP=1
INSTALL_MPI=0
OMP_NUM_THREADS=2
}
steps {
Expand All @@ -52,46 +54,68 @@ pipeline {
environment {
HOME="${WORKSPACE}"
DEVITO_OPENMP=0
INSTALL_MPI=1
}
steps {
cleanWorkspace()
condaInstallDevito()
condaInstallMPI()
runCondaTests()
runExamples()
runCodecov()
buildDocs()
}
}
stage('Build and test gcc-7 container') {
stage('Build and test gcc-7 YASK container') {
agent { dockerfile { label 'azure-linux'
filename 'Dockerfile.jenkins'
additionalBuildArgs "--build-arg gccvers=7" } }
environment {
HOME="${WORKSPACE}"
DEVITO_BACKEND="yask"
DEVITO_OPENMP="0"
INSTALL_MPI="1"
YC_CXX="g++-7"
}
steps {
cleanWorkspace()
condaInstallDevito()
condaInstallMPI()
installYask()
runCondaTests()
runCodecov()
buildDocs()
}
}
stage('Build and test gcc-7 OPS container') {
agent { dockerfile { label 'azure-linux'
filename 'Dockerfile.jenkins'
additionalBuildArgs "--build-arg gccvers=7" } }
environment {
HOME="${WORKSPACE}"
DEVITO_BACKEND="ops"
}
steps {
cleanWorkspace()
condaInstallDevito()
runCondaTests()
runCodecov()
buildDocs()
}
}
stage('Build and test gcc-8 container') {
agent { dockerfile { label 'azure-linux-8core'
filename 'Dockerfile.jenkins'
additionalBuildArgs "--build-arg gccvers=8" } }
environment {
HOME="${WORKSPACE}"
DEVITO_OPENMP=0
INSTALL_MPI=1
}
steps {
cleanWorkspace()
condaInstallDevito()
condaInstallMPI()
runCondaTests()
runExamples()
runCodecov()
Expand All @@ -114,6 +138,10 @@ def condaInstallDevito () {
sh 'source activate devito ; flake8 --exclude .conda,.git --builtins=ArgumentError .'
}

def condaInstallMPI () {
sh 'source activate devito ; pip install -r requirements-optional.txt'
}

def pipInstallDevito () {
sh "mkdir -p ${WORKSPACE}/lib/python3.6/site-packages/"
sh "python setup.py install --prefix=${WORKSPACE}"
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ docker-compose run devito /tests

# start a jupyter notebook server on port 8888
docker-compose up devito

# start a bash shell with devito
docker-compose run devito /bin/bash
```

## Examples
Expand Down
16 changes: 13 additions & 3 deletions devito/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import cpuinfo

from devito.base import * # noqa
from devito.builtins import * # noqa
from devito.data.allocators import * # noqa
from devito.dimension import * # noqa
from devito.equation import * # noqa
Expand All @@ -27,10 +28,18 @@
__version__ = get_versions()['version']
del get_versions

# Setup compiler and backend
configuration.add('compiler', 'custom', list(compiler_registry),
callback=lambda i: compiler_registry[i]())
configuration.add('backend', 'core', list(backends_registry), callback=init_backend)

# Should Devito run a first-touch Operator upon allocating data?
configuration.add('first-touch', 0, [0, 1], lambda i: bool(i), False)

# Should Devito ignore any unknown runtime arguments supplied to Operator.apply(),
# or rather raise an exception (the default behaviour)?
configuration.add('ignore-unknowns', 0, [0, 1], lambda i: bool(i), False)

# Execution mode setup
def _reinit_compiler(val): # noqa
# Force re-build the compiler
Expand All @@ -43,7 +52,7 @@ def _reinit_compiler(val): # noqa
# Autotuning setup
AT_LEVELs = ['off', 'basic', 'aggressive']
AT_MODEs = ['preemptive', 'runtime']
at_default_mode = {'core': 'preemptive', 'yask': 'runtime'}
at_default_mode = {'core': 'preemptive', 'yask': 'runtime', 'ops': 'runtime'}
at_setup = namedtuple('at_setup', 'level mode')
at_accepted = AT_LEVELs + [list(i) for i in product(AT_LEVELs, AT_MODEs)]
def _at_callback(val): # noqa
Expand All @@ -58,10 +67,11 @@ def _at_callback(val): # noqa
return at_setup(level, 'preemptive')
else:
return at_setup(level, mode)
configuration.add('autotuning', 'off', at_accepted, callback=_at_callback) # noqa
configuration.add('autotuning', 'off', at_accepted, callback=_at_callback, # noqa
impacts_jit=False)

# Should Devito emit the JIT compilation commands?
configuration.add('debug_compiler', 0, [0, 1], lambda i: bool(i))
configuration.add('debug-compiler', 0, [0, 1], lambda i: bool(i), False)

# Set the Instruction Set Architecture (ISA)
ISAs = ['cpp', 'avx', 'avx2', 'avx512']
Expand Down
2 changes: 1 addition & 1 deletion devito/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

backends = {}

backends_registry = ('core', 'yask', 'void')
backends_registry = ('core', 'yask', 'void', 'ops')


class void(object):
Expand Down
Loading

0 comments on commit d89042e

Please sign in to comment.