cb-geo / mpm

CB-Geo High-Performance Material Point Method
https://www.cb-geo.com/research/mpm
Other
235 stars 82 forks source link

Refactor resume to improve performance #702

Closed kks32 closed 3 years ago

kks32 commented 3 years ago

Describe the PR This PR refactors resume function calls so that the mpm code resumes quickly. The original design used to read and initialize all the particles, do a load balancing and delete all the non-local particles. Once this was done, HDF5 file was read to re-initialize the particles with the data from the previous step. This redundant process makes loading of particles and resuming extremely slow.

When resume is enabled, the code now directly reads the HDF5 particles data and creates the relevant particles. This allows for faster loading of resume and removes the redundant particle data movements and deletion.

Related Issues/PRs https://cb-geo.discourse.group/t/the-cost-per-timestep-after-resuming-increases/211/4

Additional context This PR is to improve the run-time of Oso landslide.

codecov[bot] commented 3 years ago

Codecov Report

Merging #702 (0d05354) into develop (c9630b3) will increase coverage by 12.87%. The diff coverage is 98.91%.

Impacted file tree graph

@@             Coverage Diff              @@
##           develop     #702       +/-   ##
============================================
+ Coverage    83.91%   96.78%   +12.87%     
============================================
  Files          169      130       -39     
  Lines        34176    25882     -8294     
============================================
- Hits         28676    25048     -3628     
+ Misses        5500      834     -4666     
Impacted Files Coverage Δ
include/mesh.h 100.00% <ø> (ø)
include/solvers/mpm_base.h 50.00% <ø> (ø)
include/mesh.tcc 82.99% <97.30%> (ø)
include/particles/particle.tcc 95.22% <100.00%> (ø)
include/solvers/mpm_base.tcc 77.04% <100.00%> (ø)
include/solvers/mpm_explicit.tcc 95.59% <100.00%> (ø)
tests/io/write_mesh_particles.cc 87.33% <100.00%> (ø)
tests/solvers/mpm_explicit_usf_test.cc 100.00% <100.00%> (ø)
tests/solvers/mpm_explicit_usl_test.cc 100.00% <100.00%> (ø)
...me/cbgeo/project/tests/materials/newtonian_test.cc
... and 298 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c9630b3...0d05354. Read the comment docs.

yliang-sn commented 3 years ago

I tested it with the OSO landslide case (more than 4 Million particles). The resume speed is good and the results look correct.