Utilities for testing in downstream projects.

Issue #47 on hold
Feng Yu created an issue

The testing framework in mpi4py does not seem to be intended to reuse in downstream projects.

I refactored the testing module in a few of my downstream projects here:

http://github.com/rainwoodman/mpi4py_test

A few example test cases are in

https://github.com/rainwoodman/MP-sort/blob/master/mpsort/tests/test_mpsort.py

Would you like to give some feedback to make it more useful?

Do you see a path forward from here?

Comments (3)

  1. Feng Yu reporter

    We have some updated infrastructure under the package name runtests.

    https://github.com/rainwoodman/runtests

    Examples:

    https://github.com/bccp/nbodykit/blob/master/nbodykit/tests/test_lab.py

    A few key things that we found useful:

    1. Being able to run a test case on different MPI communicators; MPITest(commsize) decorates a test for this.

    2. Handling uncollective / asymmetric exceptions; we currently trigger a MPI_Abort on any single rank exception. There is a nompi directive that might be useful to decorate regions of test cases where exceptions are expected to be asymmetric.

    3. mangling of outputs from different ranks. We currently capture them and dump at the end.

    4. consistent ordering of test cases.

    5. fail on the first error rather than run all tests - recovery from exceptions is hard under MPI. (some ranks may be waiting on barriers)

  2. Log in to comment