espressomd / espresso

The ESPResSo package
https://espressomd.org
GNU General Public License v3.0
230 stars 187 forks source link

Measure performance of ESPResSo LB GPU vs. waLBerla LB CPU #3899

Closed jngrad closed 3 years ago

jngrad commented 4 years ago

Measure the performance for a fluid and a fluid with particle coupling, using the ESPResSo LB implementation on GPU single-precision and the walberla implementation on CPU double-precision (and single-precision if possible), on the same workstation, e.g. lama.

jngrad commented 4 years ago

@reinaual @RudolfWeeber The waLBerla branch was ported from double to real_t in jngrad/espresso:walberla-real_t. To build with single precision, do:

cmake .. -DWITH_CCACHE=ON -DWITH_WALBERLA=ON -DWALBERLA_DOUBLE_ACCURACY=OFF -DWITH_STOKESIAN_DYNAMICS=OFF

Several LB tests fail due to rounding errors, with absolute differences of the order 10^-5 to 10^-8.

CTest output: one unit test and 6 python tests failed ``` $> make check_unit_tests 85/85 Test #65: LbWalberla_test .................. ***Failed 27.46 sec /work/jgrad/espresso-fork-walberla/src/core/unit_tests/LbWalberla.cpp(455): error: in "forces_book_keeping/_1": absolute value of (*(lb->get_node_last_applied_force(cn, true)) - f).norm(){4.097141941644287e-08} exceeds 1e-10 Failure occurred in a following context: lb_generator = ; *** 220293 failures are detected in the test module "Walberla node setters and getters test" $> make check_python 1/141 Test #29: engine_lb ...........................................***Failed 3.44 sec ====================================================================== FAIL: test_momentum_conservation (__main__.SwimmerTestWALBERLA) ---------------------------------------------------------------------- Mismatched elements: 3 / 3 (100%) Max absolute difference: 5.3081567e-05 Max relative difference: inf x: array([-5.308157e-05, 1.389081e-05, 2.329607e-05]) y: array([0., 0., 0.]) 2/141 Test #68: lb ..................................................***Failed 2.77 sec ====================================================================== FAIL: test_ext_force_density (__main__.TestLBWalberla) ---------------------------------------------------------------------- Mismatched elements: 3 / 3 (100%) Max absolute difference: 8.2433641e-05 Max relative difference: 0.00019077 x: array([7.451918, 3.887921, 0.324062]) y: array([7.452, 3.888, 0.324]) ====================================================================== FAIL: test_thermalization_force_balance (__main__.TestLBWalberla) ---------------------------------------------------------------------- Mismatched elements: 1 / 3 (33.3%) Max absolute difference: 4.94645947e-06 Max relative difference: 1.07000398e-07 x: array([-15.432864, 181.855323, 125.354238]) y: array([-15.432866, 181.855324, 125.354233]) 11/141 Test #69: lb_walberla .........................................***Failed 3.80 sec ====================================================================== FAIL: test (__main__.LbWalberlaTest) ---------------------------------------------------------------------- AssertionError: 1.3000001549720763 != 1.3 within 1e-10 delta 12/141 Test #119: lb_vtk ..............................................***Failed 5.37 sec ====================================================================== FAIL: test_vtk (__main__.TestVTK) ---------------------------------------------------------------------- Mismatched elements: 2 / 12 (16.7%) Max absolute difference: 1.4901161e-08 Max relative difference: 2.4836081e-05 x: array([0.0006 , 0.00075, 0.00075, 0.00075, 0.00075, 0.00075, 0.00075, 0.00075, 0.00075, 0.00075, 0.00075, 0.0006 ], dtype=float32) y: array([0.0006 , 0.00075, 0.00075, 0.00075, 0.00075, 0.00075, 0.00075, 0.00075, 0.00075, 0.00075, 0.00075, 0.0006 ], dtype=float32) 120/141 Test #95: observable_profileLB ................................***Failed 4.23 sec ====================================================================== FAIL: test_velocity_profile (__main__.LBWalberla) ---------------------------------------------------------------------- Mismatched elements: 1 / 3 (33.3%) Max absolute difference: 2.74181366e-06 Max relative difference: 2.49255787e-07 x: array([1.100000e+01, 2.086162e-07, 0.000000e+00]) y: array([11., 0., 0.]) 121/141 Test #116: lb_shear ............................................***Failed 3.43 sec ====================================================================== FAIL: test_xy (__main__.LBWalberlaShear) ---------------------------------------------------------------------- Mismatched elements: 1 / 3 (33.3%) Max absolute difference: 0.00029982 Max relative difference: 3. x: array([-8.942400e+03, 6.458365e+00, 1.998782e-04]) y: array([-8.942400e+03, 6.458465e+00, -9.993911e-05]) ====================================================================== FAIL: test_xz (__main__.LBWalberlaShear) ---------------------------------------------------------------------- Mismatched elements: 1 / 3 (33.3%) Max absolute difference: 0.00070513 Max relative difference: 1.9203658e+09 x: array([-8.942400e+03, 9.993911e-05, 6.458565e+00]) y: array([-8.942400e+03, -5.204170e-14, 6.458365e+00]) ====================================================================== FAIL: test_yz (__main__.LBWalberlaShear) ---------------------------------------------------------------------- Mismatched elements: 2 / 3 (66.7%) Max absolute difference: 0.0007662 Max relative difference: 1. x: array([ 4.163336e-14, -8.942400e+03, -6.458265e+00]) y: array([ 1.998782e-04, -8.942401e+03, -6.458465e+00]) ```