You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test case ShapeBasedConstraintTest.test_rhomboid in testsuite/python/constraint_shape_based.py is failing on architectures that don't have extended precision, namely ARM64 and POWER9. The test works by creating a cuboid and probing the distance between the cuboid and a particle at different positions on a 3D grid and making sure the distance vector calculated in ESPResSo matches the distance vector calculated in Python. Then a much simpler test is carried out on a rhombohedron.
To start the investigation, one should look for low-hanging fruits, such as numerical instabilities when a particle lands exactly on a corner, edge, or face of the cuboid. This happens when the lattice on which the distance vector is checked coincide with one or more of the 8 corners of the cuboid. In this case, the Python test case will take a different branch depending on whether the particle is inside or outside the cuboid, but Python and C++ don't always propagate rounding errors in the same way, and thus may disagree on whether the particle is inside or outside, which changes how the distance vector is calculated. To avoid that, one typically adds a small offset to the particle position, so that there never is a zero-component in the distance vector.
This is where the test fails on ARM64:
31/201 Test #31: constraint_shape_based ........................................***Failed 1.24 sec
...F......
======================================================================
FAIL: test_rhomboid (__main__.ShapeBasedConstraintTest.test_rhomboid)
Checks that rhomboid constraints with LJ interactions exert forces
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/espresso/mpich/testsuite/python/constraint_shape_based.py", line 914, in test_rhomboid
self.assertAlmostEqual(shape_dist_vec[1], dist_vec[1])
AssertionError: -9.0 != -3.0 within 7 places (6.0 difference)
----------------------------------------------------------------------
Ran 10 tests in 0.784s
FAILED (failures=1)
The text was updated successfully, but these errors were encountered:
The test case
ShapeBasedConstraintTest.test_rhomboid
intestsuite/python/constraint_shape_based.py
is failing on architectures that don't have extended precision, namely ARM64 and POWER9. The test works by creating a cuboid and probing the distance between the cuboid and a particle at different positions on a 3D grid and making sure the distance vector calculated in ESPResSo matches the distance vector calculated in Python. Then a much simpler test is carried out on a rhombohedron.To start the investigation, one should look for low-hanging fruits, such as numerical instabilities when a particle lands exactly on a corner, edge, or face of the cuboid. This happens when the lattice on which the distance vector is checked coincide with one or more of the 8 corners of the cuboid. In this case, the Python test case will take a different branch depending on whether the particle is inside or outside the cuboid, but Python and C++ don't always propagate rounding errors in the same way, and thus may disagree on whether the particle is inside or outside, which changes how the distance vector is calculated. To avoid that, one typically adds a small offset to the particle position, so that there never is a zero-component in the distance vector.
This is where the test fails on ARM64:
The text was updated successfully, but these errors were encountered: