-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
46 lines (41 loc) · 1.19 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
language: cpp
dist: xenial
notifications:
email: false
cache:
directories:
- $TRAVIS_BUILD_DIR/openmpi-build
- $TRAVIS_BUILD_DIR/openmpi-3.1.3
matrix:
include:
- os: linux
addons:
apt:
sources:
- deadsnakes
- ubuntu-toolchain-r-test
packages:
- python3.7-dev
- g++-7
env:
- C_COMPILER="gcc-7", CXX_COMPILER="g++-7"
before_install:
- pyenv global $(pyenv whence 2to3)
- pip install pipenv
- export MPI_BUILD_DIR=$TRAVIS_BUILD_DIR/openmpi-build
- export MPI_VERSION="3.1"
- export MPI_FULL_VERSION="3.1.3"
install:
# Non-cached builds can take some time. Tell Travis not to time out (30 min should be plenty).
- source ci/install-openmpi.sh
- echo $MPI_CC
- echo $MPI_CXX
- echo $MPI_EXEC
- env MPICC=$MPI_CC pipenv install --skip-lock
script:
# Build C++ program.
- $MPI_CXX -std=c++17 hello_mpi.cpp -o hello
# Run C++ program. Travis may not have 2 cores available. Try with 2, if fail do 1.
- $MPI_EXEC -n 2 ./hello || $MPI_EXEC -n 1 ./hello
# Run mpi4py based program.
- $MPI_EXEC -n 2 pipenv run python hello_mpi.py || $MPI_EXEC -n 1 pipenv run python hello_mpi.py