Skip to content

Commit

Permalink
Merge pull request #228 from bees4ever/travis-mpi-test
Browse files Browse the repository at this point in the history
provide a test script for travis to test mpi
  • Loading branch information
thouska authored Aug 12, 2019
2 parents dac4df0 + 3dbc087 commit be03760
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
18 changes: 13 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
language: python
python:
- "2.7"
- "3.5"
#- "2.7"
#- "3.5"
- "3.6"
- "3.7"

# command to install dependencies
# this ubuntu distribution has sure the libopenmpi-dev packages available
dist: bionic

# command to install dependencies
install:
- sudo apt-get update
- sudo apt install libopenmpi-dev openmpi-bin
- pip install mpi4py
- python setup.py install
- pip install coveralls
- pip install pathos
Expand All @@ -15,17 +22,18 @@ install:
- pip install scipy
- pip install click
- pip install deap
# Need to force pytest-cov to v2.6 as current version (2.6.1) is deprecated
# Need to force pytest-cov to v2.6 as current version (2.6.1) is deprecated and pytest:3.10.1
- pip install pytest==3.10.1 pytest-pep8 pytest-cov==2.6
# Use docutils to generate html describe
- pip install docutils
- pip install numba
- pip install tables



script:
- pip uninstall spotpy -y
- py.test spotpy/unittests/test_* --cov spotpy --cov-report term-missing -v

- mpirun -c 2 python spotpy/examples/dds/dds_parallel.py 10
after_success:
- coveralls
2 changes: 1 addition & 1 deletion spotpy/examples/dds/dds_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
print(dds_elapsed)

benchmarks_duration["dds_duration"].append(dds_elapsed)
benchmarks_duration["dds_like"].append(dds_sampler.status.objectivefunction)
benchmarks_duration["dds_like"].append(dds_sampler.status.objectivefunction_max)
benchmarks_duration["rep"].append(rep)

print(benchmarks_duration)
Expand Down
1 change: 1 addition & 0 deletions spotpy/examples/dds/dds_parallel_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"dds_duration": [], "rep": [], "dds_like": []}

0 comments on commit be03760

Please sign in to comment.