Skip to content
Snippets Groups Projects

Parallel mesh assignment also in single-node case

Merged Matthieu Schaller requested to merge parallel_mesh_assignment into master
All threads resolved!

Change the strategy used when interpolating the gpart onto the gravity mesh. Each thread (aka. top-level cell) constructs a local patch of the mesh and assigns its particles to it. When done, the patch is written to the global mesh using atomics. This is now similar to what is done in the distributed MPI case.

This strategy seems to be beneficial when there are lots of particles in only a few cells, for instance in a zoom run. It seems to not be slower in other cases either.

The behaviour can be controlled by a runtime parameter (Gravity:mesh_uses_local_patches defaults to 1) if one wants to roll back to the "old" per-particle atomic assignment.

Edited by Matthieu Schaller

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Cells with no gparts might be a problem in the MPI case too.

  • Matthieu Schaller added 33 commits

    added 33 commits

    Compare with previous version

  • added 1 commit

    • e1c9d96f - Make sure the local patches are freed after use in cell_gpart_to_mesh_CIC_mapper()

    Compare with previous version

  • Thanks John. All good points.

  • added 1 commit

    • 8b1086d5 - Also escape empty cells in the MPI version of the cell->patch interpolation mapper

    Compare with previous version

  • added 1 commit

    • 51cff14a - Make the option to use local patches instead of direct atomic writes a...

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • I have made this change a runtime parameter. I think we still want to run it in different scenarios, especially forthcoming zoom cases, to see whether it is a gain in general or not.

  • Matthieu Schaller resolved all threads

    resolved all threads

  • @dc-rope1 any final thoughts?

  • Matthieu Schaller changed the description

    changed the description

  • Nothing from me, this all seems to work (and is efficient) in the zoom case!

  • Great. So this is ready to go as well.

  • Bert Vandenbroucke approved this merge request

    approved this merge request

  • mentioned in commit 1501b338

  • Please register or sign in to reply
    Loading