usnistgov / fipy

FiPy is a Finite Volume PDE solver written in Python
http://pages.nist.gov/fipy/en/latest
Other
509 stars 149 forks source link

Fix for test failures on loki #339

Closed wd15 closed 10 years ago

wd15 commented 10 years ago

Develop at 2443725582 has test failures on loki

$ python setup.py test --modules

...

==================================================================h4. 
FAIL: Gmsh2D (fipy.meshes.gmshMesh)
Doctest: fipy.meshes.gmshMesh.Gmsh2D
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/doctest.py", line 2201, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for fipy.meshes.gmshMesh.Gmsh2D
  File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 1361, in Gmsh2D

----------------------------------------------------------------------
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 1510, in fipy.meshes.gmshMesh.Gmsh2D
Failed example:
for refine in range(4):
square = Gmsh2D(geo, background=bkg) # doctest: +GMSH
x, y = square.cellCenters # doctest: +GMSH
bkg = CellVariable(mesh=square, value=abs(x / 4) + 0.01) # doctest: +GMSH
std.append(numerix.std(numerix.sqrt(2 * square.cellVolumes) / bkg)) # doctest: +GMSH
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python2.7/doctest.py", line 1289, in __run
compileflags, 1) in test.globs
File "<doctest fipy.meshes.gmshMesh.Gmsh2D[13]>", line 2, in <module>
square = Gmsh2D(geo, background=bkg) # doctest: +GMSH
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 1565, in __init__
background=background)
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 216, in openMSHFile
f.write(background)
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 350, in write
self._writeValues(var=obj, dimensions=dimensions, time=time, timeindex=timeindex)
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 396, in _writeValues
nb_scalar_triangles = self.communicator.sum((cellTopology h2. t["triangle"]) & nonOverlapping)
File "/home/wd15/git/fipy/fipy/tools/comms/commWrapper.py", line 91, in sum
return self.epetra_comm.SumAll(numerix.array(a).sum(axis=axis))
File "/usr/lib/python2.7/dist-packages/PyTrilinos/Epetra.py", line 5361, in SumAll
return _Epetra.Comm_SumAll(self, *args)
TypeError: Require int, long or double array, got notype array
----------------------------------------------------------------------
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 1523, in fipy.meshes.gmshMesh.Gmsh2D
Failed example:
print std[-1] < 0.2 # doctest: +GMSH
Expected:
True
Got:
False
----------------------------------------------------------------------
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 1535, in fipy.meshes.gmshMesh.Gmsh2D
Failed example:
square = Gmsh2D(geo, background=bkg) # doctest: +GMSH
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python2.7/doctest.py", line 1289, in __run
compileflags, 1) in test.globs
File "<doctest fipy.meshes.gmshMesh.Gmsh2D[21]>", line 1, in <module>
square = Gmsh2D(geo, background=bkg) # doctest: +GMSH
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 1565, in __init__
background=background)
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 216, in openMSHFile
f.write(background)
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 350, in write
self._writeValues(var=obj, dimensions=dimensions, time=time, timeindex=timeindex)
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 396, in _writeValues
nb_scalar_triangles = self.communicator.sum((cellTopology t["triangle"]) & nonOverlapping)
File "/home/wd15/git/fipy/fipy/tools/comms/commWrapper.py", line 91, in sum
return self.epetra_comm.SumAll(numerix.array(a).sum(axis=axis))
File "/usr/lib/python2.7/dist-packages/PyTrilinos/Epetra.py", line 5361, in SumAll
return _Epetra.Comm_SumAll(self, *args)
TypeError: Require int, long or double array, got notype array
----------------------------------------------------------------------
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 1540, in fipy.meshes.gmshMesh.Gmsh2D
Failed example:
print std1 > std2 # doctest: +GMSH
Expected:
True
Got:
False

==============================================================h4. 
FAIL: _test (fipy.meshes.gmshMesh.Gmsh2D)
Doctest: fipy.meshes.gmshMesh.Gmsh2D._test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/doctest.py", line 2201, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for fipy.meshes.gmshMesh.Gmsh2D._test
  File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 1605, in _test

----------------------------------------------------------------------
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 1759, in fipy.meshes.gmshMesh.Gmsh2D._test
Failed example:
f.write(vol) # doctest: +GMSH
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python2.7/doctest.py", line 1289, in __run
compileflags, 1) in test.globs
File "<doctest fipy.meshes.gmshMesh.Gmsh2D._test[36]>", line 1, in <module>
f.write(vol) # doctest: +GMSH
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 350, in write
self._writeValues(var=obj, dimensions=dimensions, time=time, timeindex=timeindex)
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 396, in _writeValues
nb_scalar_triangles = self.communicator.sum((cellTopology h2. t["triangle"]) & nonOverlapping)
File "/home/wd15/git/fipy/fipy/tools/comms/commWrapper.py", line 91, in sum
return self.epetra_comm.SumAll(numerix.array(a).sum(axis=axis))
File "/usr/lib/python2.7/dist-packages/PyTrilinos/Epetra.py", line 5361, in SumAll
return _Epetra.Comm_SumAll(self, *args)
TypeError: Require int, long or double array, got notype array
----------------------------------------------------------------------
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 1763, in fipy.meshes.gmshMesh.Gmsh2D._test
Failed example:
print "".join(f.readlines())
Expected:
$PostFormat
1.4 0 8
$EndPostFormat
$View
CellVariable 1
0 0 0
0 0 0
1 0 0
1 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0 0
0
1.0 2.0 1.0
0.0 0.0 1.0
0.0 0.0 0.0
0.5 0.5 0.5
0.0 1.0 1.0 0.0
0.0 0.0 1.0 1.0
0.0 0.0 0.0 0.0
1.0 1.0 1.0 1.0
$EndView
<BLANKLINE>
Got:
$PostFormat
1.4 0 8
$EndPostFormat
$View
CellVariable 1
<BLANKLINE>

==============================================================h2. 
FAIL: _test (fipy.meshes.gmshMesh.Gmsh3D)
Doctest: fipy.meshes.gmshMesh.Gmsh3D._test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/doctest.py", line 2201, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for fipy.meshes.gmshMesh.Gmsh3D._test
  File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 1931, in _test

----------------------------------------------------------------------
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 2051, in fipy.meshes.gmshMesh.Gmsh3D._test
Failed example:
f.write(vol) # doctest: +GMSH
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python2.7/doctest.py", line 1289, in __run
compileflags, 1) in test.globs
File "<doctest fipy.meshes.gmshMesh.Gmsh3D._test[22]>", line 1, in <module>
f.write(vol) # doctest: +GMSH
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 350, in write
self._writeValues(var=obj, dimensions=dimensions, time=time, timeindex=timeindex)
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 396, in _writeValues
nb_scalar_triangles = self.communicator.sum((cellTopology t["triangle"]) & nonOverlapping)
File "/home/wd15/git/fipy/fipy/tools/comms/commWrapper.py", line 91, in sum
return self.epetra_comm.SumAll(numerix.array(a).sum(axis=axis))
File "/usr/lib/python2.7/dist-packages/PyTrilinos/Epetra.py", line 5361, in SumAll
return _Epetra.Comm_SumAll(self, *args)
TypeError: Require int, long or double array, got notype array
----------------------------------------------------------------------
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 2065, in fipy.meshes.gmshMesh.Gmsh3D._test
Failed example:
print l[-1] # doctest: +GMSH
Expected:
$EndView
<BLANKLINE>
Got:
volume 1
<BLANKLINE>
----------------------------------------------------------------------
File "/home/wd15/git/fipy/fipy/meshes/gmshMesh.py", line 2105, in fipy.meshes.gmshMesh.Gmsh3D._test
Failed example:
print numerix.allclose(a1, a2) # doctest: +GMSH
Expected:
True
Got:
False

----------------------------------------------------------------------
Ran 352 tests in 26.727s

FAILED (failures=3)

Imported from trac ticket #462, created by wd15 on 09-04-2012 at 18:40, last modified: 09-30-2013 at 21:44

wd15 commented 10 years ago

Fix with

The following changes since commit 24437255823ade97300b253211c57323e3864e23:

  Merge branch 'ticket461-svn2git-version-number-rebase' into develop (2012-09-04 15:28:32 -0400)

are available in the git repository at:

  ssh://genie.nist.gov//users/wd15/git/fipy loki-test-failures-rebase

Daniel Wheeler (1):
issue #339 -- fix for broken tests on loki -- Epetra SumAll broken

 fipy/tools/comms/commWrapper.py |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

Trac comment by wd15 on 09-05-2012 at 11:34

guyer commented 10 years ago

Replying to wd15:

Fix with

The following changes since commit 24437255823ade97300b253211c57323e3864e23:

  Merge branch 'ticket461-svn2git-version-number-rebase' into develop (2012-09-04 15:28:32 -0400)

are available in the git repository at:

  ssh://genie.nist.gov//users/wd15/git/fipy loki-test-failures-rebase

Daniel Wheeler (1):
      issue #339 -- fix for broken tests on loki -- Epetra SumAll broken

 fipy/tools/comms/commWrapper.py |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

shape is undefined if summed.shape is not (). Why doesn't this raise an error most of the time at line 96?

Trac comment by guyer on 09-05-2012 at 14:14

wd15 commented 10 years ago

Replying to guyer:

shape is undefined if summed.shape is not ().

Gawd. Well seen. Fixed that and merged it to develop with 084d3649a015

Why doesn't this raise an error most of the time at line 96?

Every case in the tests had shape () after the sum. Suggests that we need a test case that is non-flat. I'm done with it now.

Trac comment by wd15 on 09-05-2012 at 16:25

guyer commented 10 years ago

Marking milestone

Trac comment by guyer on 09-30-2013 at 21:44