Skip to content

Commit

Permalink
Merge pull request #8 from pypr/use-gh-actions
Browse files Browse the repository at this point in the history
Use github-actions for CI.
  • Loading branch information
prabhuramachandran committed Mar 9, 2021
2 parents e4a1ab1 + 22e93ca commit db922e1
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 31 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/tests.yml
@@ -0,0 +1,35 @@
name: Tests

on: pull_request

jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8, 3.9]

env:
USE_TRILINOS: 1
ZOLTAN_INCLUDE: /usr/include/trilinos
ZOLTAN_LIBRARY: /usr/lib/x86_64-linux-gnu

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Install Linux packages ZOLTAN support
run: |
sudo apt-get update
sudo apt-get install -y openmpi-bin libopenmpi-dev libtrilinos-zoltan-dev
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r requirements.txt
python setup.py develop
- name: Run tests
run: pytest -v pyzoltan
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.rst
@@ -1,10 +1,10 @@
PyZoltan: a Python wrapper for the Zoltan library
==================================================

|Travis Status| |Documentation Status|
|CI Status| |Documentation Status|

.. |Travis Status| image:: https://travis-ci.org/pypr/pyzoltan.svg?branch=master
:target: https://travis-ci.org/pypr/pyzoltan
.. |CI Status| image:: https://github.com/pypr/pyzoltan/actions/workflows/tests.yml/badge.svg
:target: https://github.com/pypr/pyzoltan/actions/workflows/tests.yml
.. |Documentation Status| image:: https://readthedocs.org/projects/pyzoltan/badge/?version=latest
:target: https://pyzoltan.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
Expand Down
4 changes: 0 additions & 4 deletions pyzoltan/core/tests/test_zoltan.py
Expand Up @@ -15,20 +15,16 @@ def setUpClass(cls):
importorskip("mpi4py.MPI")
importorskip("pyzoltan.core.zoltan")

@mark.parallel
def test_zoltan_geometric_partitioner(self):
run_parallel_script.run(
filename='geometric_partitioner.py', nprocs=4, path=path
)

@mark.slow
@mark.parallel
def test_zoltan_partition(self):
run_parallel_script.run(
filename='3d_partition.py', nprocs=4, timeout=90.0, path=path
)

@mark.parallel
def test_zoltan_zcomm(self):
run_parallel_script.run(
filename='zcomm.py', nprocs=4, path=path
Expand Down
7 changes: 5 additions & 2 deletions pyzoltan/tools/run_parallel_script.py
Expand Up @@ -14,7 +14,8 @@ def kill_process(process):
process.kill()


def run(filename, args=None, nprocs=2, timeout=30.0, path=None):
def run(filename, args=None, nprocs=2, timeout=30.0, path=None,
mpi_extra=None):
"""Run a python script with MPI or in serial (if nprocs=1). Kill process
if it takes longer than the specified timeout.
Expand All @@ -27,12 +28,14 @@ def run(filename, args=None, nprocs=2, timeout=30.0, path=None):
else raise a RuntimeError exception.
path - the path under which the script is located
Defaults to the location of this file (__file__), not curdir.
mpi_extra: List of additional arguments to mpiexec.
"""
if args is None:
args = []
file_path = abspath(join(path, filename))
cmd = [sys.executable, file_path] + args
extra = ['--oversubscribe'] if mpi_extra is None else mpi_extra
cmd = extra + [sys.executable, file_path] + args
if nprocs > 1:
cmd = ['mpiexec', '-n', str(nprocs)] + cmd

Expand Down

0 comments on commit db922e1

Please sign in to comment.