Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • SWIFTsim SWIFTsim
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 57
    • Issues 57
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 21
    • Merge requests 21
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • SWIFT
  • SWIFTsimSWIFTsim
  • Merge requests
  • !716

Delayed foreign allocation

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Matthieu Schaller requested to merge delayed_foreign_allocation into master Jan 12, 2019
  • Overview 5
  • Commits 13
  • Changes 6

Fixes #456 (closed).

We don't blindly allocate memory for foreign particles based on the top-level cell content any more. The new strategy is to recurse once down the cells once all the tasks (including the local-foreign pairs and MPI comms) have been constructed. In this first pass we only go down to the level where we reach tasks (so it's rather quick). We use this to count the number of particles that we will need to allocate. We then do that and finally link the particle arrays to their cells in the same way as before, just starting from the super level instead of the top level.

This saves quite a bit of memory and is also marginally faster as we only recurse into the parts of the (foreign) tree that we need to.

Future improvements possibly include:

  • Do the same for the stars once we a have a better star-over-MPI strategy.
  • Use the threadpool to parallelize the recursion since it is embarassingly parallel. (But it's also fast so do we care?)
Edited Jan 15, 2019 by Matthieu Schaller
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: delayed_foreign_allocation