Skip to content

Commit

Permalink
smaller test base
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Nov 9, 2018
1 parent d4fd3d2 commit 4900013
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 66 deletions.
22 changes: 7 additions & 15 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=True INSTALL_TYPE=conda MPI_INSTALL=0
- os: linux
python: "3.6"
addons:
Expand All @@ -40,16 +40,6 @@ matrix:
- 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=1
- os: linux
python: "3.6"
addons:
apt:
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
- os: linux
python: "3.6"
addons:
Expand Down Expand Up @@ -87,7 +77,9 @@ 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
Expand All @@ -97,9 +89,9 @@ install:
pip install -e .;
conda list;
fi
- if [[ "$MPI_INSTALL" == '1' ]]; then
pip install -r mpi_requirements.txt;
fi

# Install mpi4py if mpi is installed
- if [[ $INSTALL_TYPE == 'conda' ]] && [[ $MPI_INSTALL == '1' ]]; then pip install -r mpi_requirements.txt; fi

# Install devito with pip
- if [[ $INSTALL_TYPE == 'pip_setup' ]]; then python setup.py install; fi
Expand Down
47 changes: 5 additions & 42 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pipeline {
environment {
HOME="${WORKSPACE}"
DEVITO_OPENMP=0
INSTALL_MPI=0
INSTALL_MPI=1
PYTHONPATH="${WORKSPACE}/lib/python3.6/site-packages/"
}
steps {
Expand All @@ -28,51 +28,14 @@ pipeline {
runPipTests()
}
}
// For each combination of parameters required, build and test
stage('Build and test gcc-4.9 container with MPI') {
agent { dockerfile { label 'azure-linux-8core'
filename 'Dockerfile.jenkins'
additionalBuildArgs "--build-arg gccvers=4.9" } }
environment {
HOME="${WORKSPACE}"
DEVITO_OPENMP=0
INSTALL_MPI=1
PYTHONPATH="${WORKSPACE}/lib/python3.6/site-packages/"
}
steps {
cleanWorkspace()
pipInstallDevito()
runPipTests()
}
}
stage('Build and test gcc-4.9 OpenMP container') {
agent { dockerfile { label 'azure-linux-8core'
filename 'Dockerfile.jenkins'
additionalBuildArgs "--build-arg gccvers=4.9" } }
environment {
HOME="${WORKSPACE}"
DEVITO_OPENMP=1
INSTALL_MPI=1
OMP_NUM_THREADS=2
}
steps {
cleanWorkspace()
condaInstallDevito()
condaInstallMPI()
runCondaTests()
runExamples()
runCodecov()
buildDocs()
}
}
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
INSTALL_MPI=0
OMP_NUM_THREADS=2
}
steps {
Expand All @@ -91,7 +54,7 @@ pipeline {
environment {
HOME="${WORKSPACE}"
DEVITO_OPENMP=0
INSTALL_MPI=1
INSTALL_MPI=1
}
steps {
cleanWorkspace()
Expand All @@ -111,7 +74,7 @@ pipeline {
HOME="${WORKSPACE}"
DEVITO_BACKEND="yask"
DEVITO_OPENMP="0"
INSTALL_MPI="1"
INSTALL_MPI="1"
YC_CXX="g++-7"
}
steps {
Expand All @@ -131,7 +94,7 @@ pipeline {
environment {
HOME="${WORKSPACE}"
DEVITO_OPENMP=0
INSTALL_MPI=1
INSTALL_MPI=1
}
steps {
cleanWorkspace()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
else:
reqs += [ir]

if os.environ.get('INSTALL_MPI') == '1':
if os.system('which mpicc') == '0':
reqs += ['mpi4py']

setup(name='devito',
Expand Down
15 changes: 7 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,18 @@ def wrapper(*args, **kwargs):
return dec


# Support to run MPI tests
# This is partly extracted from:
# `https://github.com/firedrakeproject/firedrake/blob/master/tests/conftest.py`

mpi_exec = 'mpiexec'
mpi_distro = sniff_mpi_distro(mpi_exec)


def parallel(item):
"""Run a test in parallel.
:parameter item: The test item to run.
"""
# Support to run MPI tests
# This is partly extracted from:
# `https://github.com/firedrakeproject/firedrake/blob/master/tests/conftest.py`

mpi_exec = 'mpiexec'
mpi_distro = sniff_mpi_distro(mpi_exec)

marker = item.get_closest_marker("parallel")
nprocs = as_tuple(marker.kwargs.get("nprocs", 2))
for i in nprocs:
Expand Down

0 comments on commit 4900013

Please sign in to comment.