Skip to content

Commit 3101cf3

Browse files
committed
Merge branch 'master' of github.com:igfuw/libmpdataxx into record_aux_const_arrays
2 parents 9e7b766 + e14cb25 commit 3101cf3

File tree

102 files changed

+3142
-669
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+3142
-669
lines changed

.travis.yml

Lines changed: 170 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,139 @@
1+
#TODO: precache could be done only with one job, but the compiled libs would need to be uploaded to some external storage (wizard? ams s3?);
2+
# then a problem with secure storage of credentials appears - they could be stored in encrypted env vars on travis, but that would make it impossible to start PRs from forked repos;
3+
# add an additional compile stage with jobs only for different os/compilers, not env vars (needs external storage as well)
4+
# example of a hack how to share cache among different jobs (might mean we do not need external storage):
5+
# - https://github.com/travis-ci/travis-ci/issues/7590
6+
# - https://github.com/qTox/qTox/blob/59b5578c7bffc56f6227c60bfcb38f97d39ec8d9/.travis.yml
7+
8+
stages:
9+
- precache
10+
- test
11+
112
language: cpp
213
os:
314
- linux
4-
- osx
5-
dist: trusty
15+
# - osx
16+
dist: xenial
617
compiler:
718
- gcc
819
- clang
920
env:
10-
- TEST_SUITE=unit
11-
- TEST_SUITE=sandbox
12-
- TEST_SUITE=paper
13-
- TEST_SUITE=elliptic_drop
14-
- TEST_SUITE=nair_jablonowski_2008
15-
- TEST_SUITE=pbl
16-
- TEST_SUITE=osx_local_clang
17-
- TEST_SUITE=UWLCM_MT
18-
- TEST_SUITE=UWLCM_unit_iles
19-
- TEST_SUITE=UWLCM_unit_smg
20-
21-
matrix:
21+
# - MPI=none
22+
# - MPI=openmpi
23+
# not supported by Boost.MPI in Debian on amd64:
24+
# - MPI=lam
25+
# - MPI=mpich
26+
27+
- TEST_SUITE=unit MPI=none
28+
- TEST_SUITE=sandbox MPI=none
29+
- TEST_SUITE=paper MPI=none
30+
- TEST_SUITE=elliptic_drop MPI=none
31+
- TEST_SUITE=nair_jablonowski_2008 MPI=none
32+
- TEST_SUITE=UWLCM_MT MPI=none
33+
- TEST_SUITE=UWLCM_unit_iles MPI=none
34+
- TEST_SUITE=UWLCM_unit_smg MPI=none
35+
- TEST_SUITE=pbl MPI=none
36+
- TEST_SUITE=osx_local_clang MPI=none
37+
- TEST_SUITE=unit MPI=mvapich2
38+
- TEST_SUITE=sandbox MPI=mvapich2
39+
# MPI paper tests don't do file comparison and plotting; TODO: fix them
40+
- TEST_SUITE=paper MPI=mvapich2
41+
- TEST_SUITE=elliptic_drop MPI=mvapich2
42+
# disabled, because polar bconds dont work with MPI
43+
# - TEST_SUITE=nair_jablonowski_2008 MPI=mvapich2
44+
- TEST_SUITE=pbl MPI=mvapich2
45+
# bconds_div has to be ran separately with mpi because of timeouts
46+
- TEST_SUITE=bconds_div MPI=mvapich2
47+
# TODO: once libcloud MPI works, turn UWLCM MPI test on
48+
# - TEST_SUITE=UWLCM MPI=mvapich2
49+
50+
cache:
51+
directories:
52+
- ${TRAVIS_BUILD_DIR}/deps/mvapich2-2.3b
53+
- ${TRAVIS_BUILD_DIR}/deps/boost
54+
- ${TRAVIS_BUILD_DIR}/deps/hdf5
55+
- /home/travis/.rvm/ # following Travis cache documentation: try to cache installed ruby on osx
56+
57+
# define the precache stage
58+
# empty phases mean that default phases (before_install, install, ...) from the test stage are used (?)
59+
# TODO: precache stage has a lot of unnecessary before_install and install code common to the (default) test stage;
60+
# add after_success, after_failure to precache, remove building of caches from the test stage, make the build error instead;
61+
62+
# YAML alias for the options common to precache jobs
63+
aliases:
64+
- &precache_default
65+
stage: precache
66+
# os: linux
67+
# dist: xenial
68+
# language: cpp
69+
# compiler: gcc
70+
install:
71+
- . ./.travis_scripts/install_common.sh
72+
script: echo "Preparing cache finished"
73+
74+
jobs:
75+
include:
76+
- <<: *precache_default
77+
env: TEST_SUITE=unit MPI=mvapich2
78+
- <<: *precache_default
79+
env: TEST_SUITE=sandbox MPI=mvapich2
80+
- <<: *precache_default
81+
env: TEST_SUITE=paper MPI=mvapich2
82+
- <<: *precache_default
83+
env: TEST_SUITE=elliptic_drop MPI=mvapich2
84+
- <<: *precache_default
85+
env: TEST_SUITE=nair_jablonowski_2008 MPI=mvapich2
86+
- <<: *precache_default
87+
env: TEST_SUITE=pbl MPI=mvapich2
88+
- <<: *precache_default
89+
env: TEST_SUITE=bconds_div MPI=mvapich2
90+
91+
# excluded jobs
2292
exclude:
93+
# MPI with clang disabled due to difficulties with building boost with clang
94+
- compiler: clang
95+
env: TEST_SUITE=unit MPI=mvapich2
96+
- compiler: clang
97+
env: TEST_SUITE=sandbox MPI=mvapich2
98+
- compiler: clang
99+
env: TEST_SUITE=paper MPI=mvapich2
100+
- compiler: clang
101+
env: TEST_SUITE=elliptic_drop MPI=mvapich2
102+
- compiler: clang
103+
env: TEST_SUITE=nair_jablonowski_2008 MPI=mvapich2
104+
- compiler: clang
105+
env: TEST_SUITE=pbl MPI=mvapich2
106+
- compiler: clang
107+
env: TEST_SUITE=bconds_div MPI=mvapich2
108+
23109
- os: osx
24-
compiler: gcc
25-
110+
env: TEST_SUITE=pbl MPI=none # pbl not tested on osx
26111
- os: osx
27-
env: TEST_SUITE=pbl # pbl not tested on osx
112+
compiler: gcc
28113

29114
- compiler: clang
30-
env: TEST_SUITE=UWLCM_MT
115+
env: TEST_SUITE=UWLCM_MT MPI=none
31116
- compiler: clang
32-
env: TEST_SUITE=UWLCM_unit_iles
117+
env: TEST_SUITE=UWLCM_unit_iles MPI=none
33118
- compiler: clang
34-
env: TEST_SUITE=UWLCM_unit_smg
119+
env: TEST_SUITE=UWLCM_unit_smg MPI=none
35120

36121
# local clang tests on osx
37122
- os: linux
38-
env: TEST_SUITE=osx_local_clang
123+
env: TEST_SUITE=osx_local_clang MPI=none
39124
- compiler: gcc
40-
env: TEST_SUITE=osx_local_clang
125+
env: TEST_SUITE=osx_local_clang MPI=none
41126
addons:
42127
apt:
43128
packages:
44129
- g++-6
45-
- clang-4.0
46-
- boost1.61
130+
- clang-5.0
131+
- python3-pip
132+
- python3-setuptools
47133
sources: &sources
48134
- sourceline: 'ppa:rakhimov/boost'
49135
- ubuntu-toolchain-r-test
50-
- llvm-toolchain-trusty-4.0
136+
- llvm-toolchain-xenial
51137

52138
before_install:
53139
# define a compiler variable for use in if statements
@@ -56,20 +142,32 @@ before_install:
56142
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then export COMPILER=clang++; fi # only clang on osx
57143

58144
# to avoid python lib/interpreter mismatch; https://github.com/travis-ci/travis-ci/issues/5326
59-
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g"); fi
60-
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main universe multiverse"; fi
61-
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get update; fi
62-
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -t trusty -y"; fi
63-
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update; fi
145+
# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g"); fi
146+
# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main universe multiverse"; fi
147+
# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo apt-get update; fi
148+
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then export apt_get_install="apt-get install --no-install-recommends -t xenial -y"; fi
149+
# - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew update; fi
150+
151+
# - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew tap homebrew/science; fi
152+
# - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm get stable; fi #see https://github.com/travis-ci/travis-ci/issues/6307
64153

65154
# Workaround for upgrading gcc, see https://github.com/travis-ci/travis-ci/issues/8826
66155
# Seems like this is now done by Travis, but leaving it (commented out) for now
67156
#- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew cask uninstall oclint; fi
157+
158+
# gnuplot-iostream
159+
- git clone -n https://github.com/dstahlke/gnuplot-iostream && cd gnuplot-iostream
160+
- git checkout 8b6e30c6ea5ee4f07ccf90d858d35a10cf67a3e2 # later commits require c++17
161+
- sudo cp gnuplot-iostream.h /usr/local/include/gnuplot-iostream.h
162+
- cd ..
68163

69164
# needed to get rvm, see below
70165
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then \curl -sSL https://get.rvm.io | bash -s -- --branch stable; fi
71166
# https://github.com/travis-ci/travis-ci/issues/10165
72167
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm reload; fi
168+
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm list known; fi
169+
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm install ruby-2.6; fi
170+
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then rvm use 2.6; fi
73171

74172
# locally installed stuff comes first
75173
- export PATH=/usr/local/bin:$PATH
@@ -80,62 +178,59 @@ before_install:
80178
# to avoid problems with plotting by paraview on Travis
81179
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then unset DISPLAY; fi
82180

83-
# you may not believe it, but GCC (4.8.2) is giving ICEs otherwise!
84-
- export make_j="make -j 2"
85-
- if [[ $COMPILER == 'g++' ]]; then export make_j="make"; fi
181+
- export make_j="make -j 4"
86182

87-
# testing both Python 2 and 3 on Linux (unrelated to compiler choice!)
183+
# testing Python 3 on Linux
88184
- export PY3DEB=""
89-
- if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then PY3DEB=3; fi
90-
- if [[ $PY3DEB != '' ]]; then sudo apt-get install python3-dev; fi
185+
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then PY3DEB=3; fi
186+
# - PY3DEB=3 # had problems with building h5py using python3-pip
187+
# - if [[ $PY3DEB != '' ]]; then sudo apt-get install python3-dev; fi
91188

92189
# upgrade pip
93-
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install --upgrade pip; fi
94-
95-
install:
96-
# silence the gazillion warnings coming from blitz headers when using the osx clang
97-
- if [[ $TRAVIS_OS_NAME == 'osx' && $COMPILER == 'clang++' ]]; then export CXXFLAGS="-Wno-parentheses ${CXXFLAGS}"; fi
98-
99-
# redefine CXX to the actual version used
100-
- if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'clang++' ]]; then export CXX=clang++-4.0; fi
101-
- if [[ $TRAVIS_OS_NAME == 'linux' && $COMPILER == 'g++' ]]; then export CXX=g++-6; fi
102-
# downloads and setups local clang on osx
103-
- if [[ $TEST_SUITE == 'osx_local_clang' ]]; then . ./.travis_scripts/setup_local_clang.sh; fi
190+
#- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install --upgrade pip; fi
191+
- sudo pip$PY3DEB install --upgrade pip
104192

105-
# latest boost is installed using addons functionality
106-
107-
# cmake
108-
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then wget https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2-Linux-x86_64.sh; fi
109-
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo sh cmake-3.13.2-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir; fi
110-
111-
# blitz
112-
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install blitz; fi
113-
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libblitz0-dev; fi
193+
install:
194+
- . ./.travis_scripts/install_common.sh
114195

115-
# hdf5
116-
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" libpango-1.0-0 libpangocairo-1.0-0 libhdf5-dev; fi
117-
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install hdf5-tools; fi
196+
# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" libpango-1.0-0 libpangocairo-1.0-0 libhdf5-dev; fi
197+
# - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install hdf5-tools; fi
118198
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install hdf5; fi
119199

120-
# gnuplot-iostream
121200
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install gnuplot-nox; fi
122201
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install gnuplot; fi
123-
- sudo wget -O /usr/local/include/gnuplot-iostream.h https://raw.githubusercontent.com/dstahlke/gnuplot-iostream/master/gnuplot-iostream.h
202+
203+
# Python modules
204+
# make Python 3 the default if requested
205+
- if [[ $TRAVIS_OS_NAME == 'linux' && $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi
124206

125207
# h5py
126-
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-h5py; fi
127-
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install h5py; fi
208+
- if [[ $TRAVIS_OS_NAME == 'linux' && $MPI == 'none' ]]; then sudo $apt_get_install python$PY3DEB-h5py; fi
209+
# build h5py with mpi support
210+
#- if [[ $TRAVIS_OS_NAME == 'linux' && $MPI != 'none' ]]; then sudo pip install mpi4py; fi
211+
- |
212+
if [[ $TRAVIS_OS_NAME == 'linux' && $MPI != 'none' ]]; then
213+
sudo pip$PY3DEB install Cython # to generate the C wrappers
214+
#sudo pip install https://bitbucket.org/mpi4py/mpi4py/get/master.tar.gz
215+
mkdir mpi4py
216+
cd mpi4py
217+
travis_retry wget --no-check-certificate --quiet -O - https://bitbucket.org/mpi4py/mpi4py/get/master.tar.gz | tar --strip-components=1 -xz
218+
python setup.py build
219+
sudo python setup.py install
220+
cd ..
221+
fi
222+
# h5py uninstallation following https://github.com/h5py/h5py/issues/672
223+
- if [[ $TRAVIS_OS_NAME == 'linux' && $MPI != 'none' ]]; then sudo -H pip$PY3DEB uninstall h5py; fi
224+
- if [[ $TRAVIS_OS_NAME == 'linux' && $MPI != 'none' ]]; then HDF5_DIR=$HDF5_ROOT HDF5_MPI="ON" sudo -H pip$PY3DEB install --no-cache-dir --no-binary=h5py h5py; fi
225+
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip$PY3DEB install h5py; fi
128226

129227
# scipy
130228
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-scipy; fi
131-
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install scipy; fi
229+
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip$PY3DEB install scipy; fi
132230

133231
# matplotlib
134232
- if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python$PY3DEB-matplotlib; fi
135-
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip install matplotlib; fi
136-
137-
# make Python 3 the default if requested
138-
- if [[ $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10; fi
233+
- if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo pip$PY3DEB install matplotlib; fi
139234

140235
script:
141236
# libmpdata++
@@ -146,7 +241,7 @@ script:
146241
- cd ../..
147242

148243
# compiling and running all unit tests in Debug & Release modes
149-
- if [[ $TEST_SUITE == 'unit' ]]; then . ./.travis_scripts/unit.sh; fi
244+
- if [[ $TEST_SUITE == 'unit' ]]; then . ./.travis_scripts/unit.sh; fi # with '.' to pass env vars
150245

151246
# compiling and running selected paper tests in Debug mode
152247
- if [[ $TEST_SUITE == 'paper' ]]; then . ./.travis_scripts/paper.sh; fi
@@ -166,6 +261,11 @@ script:
166261

167262
# running pbl tests in Release mode
168263
- if [[ $TEST_SUITE == 'pbl' ]]; then . ./.travis_scripts/pbl.sh; fi
169-
264+
265+
# running bconds_div tests in Release mode
266+
- if [[ $TEST_SUITE == 'bcond_div' ]]; then . ./.travis_scripts/bconds_div.sh; fi
267+
170268
# testing local clang on osx
171269
- if [[ $TEST_SUITE == 'osx_local_clang' ]]; then . ./.travis_scripts/unit.sh; fi # with '.' to pass env vars
270+
271+

.travis_scripts/UWLCM.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ if [[ $PY3DEB != '' ]]; then sudo update-alternatives --remove python /usr/bin/p
1616
if [[ $PY3DEB != '' ]]; then sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 10; fi
1717

1818
# libcloudph++'s dependencies
19-
#if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libboost-python-dev python-numpy; fi
19+
#if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libboost-python1.55-dev python-numpy; fi
2020
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install python-numpy; fi
2121
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then brew install boost-python; fi
22-
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then git clone --depth=1 git://github.com/thrust/thrust.git; fi
23-
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then sudo ln -s `pwd`/thrust/thrust /usr/local/include/thrust; fi
2422

2523
# odeint
2624
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then git clone --depth=1 https://github.com/boostorg/odeint.git; fi # get boost odeint > 1.58
@@ -45,7 +43,7 @@ sudo make install
4543
cd ../..
4644

4745
# UWLCM
48-
# if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libboost-program-options-dev; fi
46+
# if [[ $TRAVIS_OS_NAME == 'linux' ]]; then sudo $apt_get_install libboost-program-options1.55-dev; fi
4947
git clone --depth=1 git://github.com/igfuw/UWLCM.git
5048
cd UWLCM
5149
. .travis_scripts/$1.sh

.travis_scripts/bconds_div.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env sh
2+
set -e
3+
cd tests/sandbox
4+
mkdir build
5+
cd build
6+
cmake ..
7+
VERBOSE=1 $make_j
8+
# running bconds_div in Release mode
9+
# "/" intentional! (just to make cat exit with an error code)
10+
OMP_NUM_THREADS=4 make -C 6_bconds_div test || cat 6_bconds_div/Testing/Temporary/LastTest.log /
11+
cd ../../..

0 commit comments

Comments
 (0)