Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests that don't work in parallel #550

Merged
merged 3 commits into from
Jan 19, 2018

Conversation

guyer
Copy link
Member

@guyer guyer commented Jan 18, 2018

A few tests don't look like they ever worked in parallel. This pull requests ensures the run in serial or on processor 0 only.

guyer added 2 commits January 17, 2018 21:18
This mesh is too small to parallelize
and periodic meshes don't work in parallel (usnistgov#518)
Other tests are on serial meshes, but it seems like these got missed
@guyer guyer requested review from wd15 and tkphd January 18, 2018 02:39
@wd15
Copy link
Contributor

wd15 commented Jan 19, 2018

@guyer, get the same 3 Gmsh related errors in serial and parallel FiPy segfaults for me when I try and run the tests.

$ mpirun -np python setup.py test
[mpiexec@barrow] HYD_pmcd_pmi_alloc_pg_scratch (pm/pmiserv/pmiserv_utils.c:527): assert (pg->pg_process_count * sizeof(struct HYD_pmcd_pmi_ecount)) failed
[mpiexec@barrow] HYD_pmci_launch_procs (pm/pmiserv/pmiserv_pmci.c:108): error allocating pg scratch space
Segmentation fault (core dumped)

but `mpirun -np 2 python examples/parallel.py" works.

@guyer
Copy link
Member Author

guyer commented Jan 19, 2018

@wd15 Did you literally write mpirun -np python setup.py test or mpirun -np 2 python setup.py test?

@guyer guyer merged commit 9f81cbd into usnistgov:develop Jan 19, 2018
@guyer guyer deleted the fix_tests_that_dont_work_in_parallel branch January 19, 2018 17:57
@wd15
Copy link
Contributor

wd15 commented Jan 19, 2018

@guyer, I literally did! 3 errors when I run using -np 2.

======================================================================
FAIL: _test (fipy.meshes.gmshMesh.GmshGrid2D)
Doctest: fipy.meshes.gmshMesh.GmshGrid2D._test======================================================================
FAIL: _test (fipy.meshes.gmshMesh.GmshGrid2D)
Doctest: fipy.meshes.gmshMesh.GmshGrid2D._test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/wd15/miniconda/envs/fipy/lib/python2.7/doctest.py", line 2226, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for fipy.meshes.gmshMesh.GmshGrid2D._test
  File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2189, in _test

----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2200, in fipy.meshes.gmshMesh.GmshGrid2D._test
Failed example:
    numerix.allclose(yogmsh._faceAreas, yogrid._faceAreas) # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2203, in fipy.meshes.gmshMesh.GmshGrid2D._test
Failed example:
    yogmsh.cellCenters.value.size == yogrid.cellCenters.value.size # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2208, in fipy.meshes.gmshMesh.GmshGrid2D._test
Failed example:
    mesh.numberOfCells == 4 # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2211, in fipy.meshes.gmshMesh.GmshGrid2D._test
Failed example:
    len(mesh.faceCenters[0]) == 12 # doctest: +GMSH
Expected:
    True
Got:
    False


======================================================================
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/wd15/miniconda/envs/fipy/lib/python2.7/doctest.py", line 2226, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for fipy.meshes.gmshMesh.GmshGrid2D._test
  File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2189, in _test

----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2200, in fipy.meshes.gmshMesh.GmshGrid2D._test
Failed example:
    numerix.allclose(yogmsh._faceAreas, yogrid._faceAreas) # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2203, in fipy.meshes.gmshMesh.GmshGrid2D._test
Failed example:
    yogmsh.cellCenters.value.size == yogrid.cellCenters.value.size # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2208, in fipy.meshes.gmshMesh.GmshGrid2D._test
Failed example:
    mesh.numberOfCells == 4 # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2211, in fipy.meshes.gmshMesh.GmshGrid2D._test
Failed example:
    len(mesh.faceCenters[0]) == 12 # doctest: +GMSH
Expected:
    True
Got:
    False


======================================================================

FAIL: _test (fipy.meshes.gmshMesh.GmshGrid3D)
Doctest: fipy.meshes.gmshMesh.GmshGrid3D._test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/wd15/miniconda/envs/fipy/lib/python2.7/doctest.py", line 2226, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for fipy.meshes.gmshMesh.GmshGrid3D._test
  File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2263, in _test

----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2277, in fipy.meshes.gmshMesh.GmshGrid3D._test
Failed example:
    yogmsh.cellCenters.value.size == yogrid.cellCenters.value.size # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2280, in fipy.meshes.gmshMesh.GmshGrid3D._test
Failed example:
    numerix.allclose(yogmsh._faceAreas, yogrid._faceAreas) # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2283, in fipy.meshes.gmshMesh.GmshGrid3D._test
Failed example:
    numerix.allclose(yogmsh._faceAreas, yogrid._faceAreas) # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2292, in fipy.meshes.gmshMesh.GmshGrid3D._test
Failed example:
    len(mesh.cellCenters.value[0]) == 8 # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2299, in fipy.meshes.gmshMesh.GmshGrid3D._test
Failed example:
    nx.allclose(mesh._faceAreas, faceAreas) # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2309, in fipy.meshes.gmshMesh.GmshGrid3D._test
Failed example:
    nx.allclose(mesh._cellAreas, cellAreas) # doctest: +GMSH
Expected:
    True
Got:
    False


======================================================================FAIL: _test (fipy.meshes.gmshMesh.GmshGrid3D)
Doctest: fipy.meshes.gmshMesh.GmshGrid3D._test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/wd15/miniconda/envs/fipy/lib/python2.7/doctest.py", line 2226, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for fipy.meshes.gmshMesh.GmshGrid3D._test
  File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2263, in _test

----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2277, in fipy.meshes.gmshMesh.GmshGrid3D._test
Failed example:
    yogmsh.cellCenters.value.size == yogrid.cellCenters.value.size # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2280, in fipy.meshes.gmshMesh.GmshGrid3D._test
Failed example:
    numerix.allclose(yogmsh._faceAreas, yogrid._faceAreas) # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2283, in fipy.meshes.gmshMesh.GmshGrid3D._test
Failed example:
    numerix.allclose(yogmsh._faceAreas, yogrid._faceAreas) # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2292, in fipy.meshes.gmshMesh.GmshGrid3D._test
Failed example:
    len(mesh.cellCenters.value[0]) == 8 # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2299, in fipy.meshes.gmshMesh.GmshGrid3D._test
Failed example:
    nx.allclose(mesh._faceAreas, faceAreas) # doctest: +GMSH
Expected:
    True
Got:
    False
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/fipy/meshes/gmshMesh.py", line 2309, in fipy.meshes.gmshMesh.GmshGrid3D._test
Failed example:
    nx.allclose(mesh._cellAreas, cellAreas) # doctest: +GMSH
Expected:
    True
Got:
    False


======================================================================

FAIL: anisotropy (examples.diffusion)
Doctest: examples.diffusion.anisotropy
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/wd15/miniconda/envs/fipy/lib/python2.7/doctest.py", line 2226, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for examples.diffusion.anisotropy
  File "/home/wd15/git/fipy-project/fipy/examples/diffusion/anisotropy.py", line 6, in anisotropy

----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/examples/diffusion/anisotropy.py", line 87, in examples.diffusion.anisotropy
Failed example:
    for i in range(20):
        var.updateOld() # doctest: +GMSH
        res = 1.

        while res > 1e-2:
            res = eqn.sweep(var, dt=dt) # doctest: +GMSH

        if __name__ == '__main__':
            viewer.plot()
        time += dt
Exception raised:
    Traceback (most recent call last):
      File "/home/wd15/miniconda/envs/fipy/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest examples.diffusion.anisotropy[17]>", line 6, in <module>
        res = eqn.sweep(var, dt=dt) # doctest: +GMSH
      File "/home/wd15/git/fipy-project/fipy/fipy/terms/term.py", line 225, in sweep
        residual = solver._calcResidual(residualFn=residualFn)
      File "/home/wd15/git/fipy-project/fipy/fipy/solvers/trilinos/trilinosSolver.py", line 165, in _calcResidual
        return comm.Norm2(residual)
      File "/home/wd15/git/fipy-project/fipy/fipy/tools/comms/serialCommWrapper.py", line 52, in Norm2
        return numerix.L2norm(vec)
      File "/home/wd15/git/fipy-project/fipy/fipy/tools/numerix.py", line 940, in L2norm
        return sqrt(add.reduce(arr**2))
    TypeError: unsupported operand type(s) for ** or pow(): 'Vector' and 'int'
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/examples/diffusion/anisotropy.py", line 102, in examples.diffusion.anisotropy
Failed example:
    print max(abs((var - solution) / max(solution))) < 0.08 # doctest: +GMSH
Expected:
    True
Got:
    False


FAIL: anisotropy (examples.diffusion)
Doctest: examples.diffusion.anisotropy
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/wd15/miniconda/envs/fipy/lib/python2.7/doctest.py", line 2226, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for examples.diffusion.anisotropy
  File "/home/wd15/git/fipy-project/fipy/examples/diffusion/anisotropy.py", line 6, in anisotropy

----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/examples/diffusion/anisotropy.py", line 87, in examples.diffusion.anisotropy
Failed example:
    for i in range(20):
        var.updateOld() # doctest: +GMSH
        res = 1.

        while res > 1e-2:
            res = eqn.sweep(var, dt=dt) # doctest: +GMSH

        if __name__ == '__main__':
            viewer.plot()
        time += dt
Exception raised:
    Traceback (most recent call last):
      File "/home/wd15/miniconda/envs/fipy/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest examples.diffusion.anisotropy[17]>", line 6, in <module>
        res = eqn.sweep(var, dt=dt) # doctest: +GMSH
      File "/home/wd15/git/fipy-project/fipy/fipy/terms/term.py", line 225, in sweep
        residual = solver._calcResidual(residualFn=residualFn)
      File "/home/wd15/git/fipy-project/fipy/fipy/solvers/trilinos/trilinosSolver.py", line 165, in _calcResidual
        return comm.Norm2(residual)
      File "/home/wd15/git/fipy-project/fipy/fipy/tools/comms/serialCommWrapper.py", line 52, in Norm2
        return numerix.L2norm(vec)
      File "/home/wd15/git/fipy-project/fipy/fipy/tools/numerix.py", line 940, in L2norm
        return sqrt(add.reduce(arr**2))
    TypeError: unsupported operand type(s) for ** or pow(): 'Vector' and 'int'
----------------------------------------------------------------------
File "/home/wd15/git/fipy-project/fipy/examples/diffusion/anisotropy.py", line 102, in examples.diffusion.anisotropy
Failed example:
    print max(abs((var - solution) / max(solution))) < 0.08 # doctest: +GMSH
Expected:
    True
Got:
    False


----------------------------------------------------------------------
Ran 555 tests in 311.640s

----------------------------------------------------------------------
Ran 555 tests in 311.641s

FAILED (failures=3)
FAILED (failures=3)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Skipped 2 doctest examples because `lsmlib` must be used to run some tests
Skipped 2 doctest examples because the PySparse solvers are not being used.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Skipped 2 doctest examples because `lsmlib` must be used to run some tests
Skipped 2 doctest examples because the PySparse solvers are not being used.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants