zhafen / linefinder

A tool for finding and classifying the worldlines of Lagrangian parcels of mass, in the context of hydrodynamic simulations of galaxy formation.
https://zhafen.github.io/linefinder
MIT License
0 stars 1 forks source link

Finding the circular velocity at a given radius is prohibitively memory intensive #47

Closed zhafen closed 6 years ago

zhafen commented 6 years ago

Originally reported by Zachary Hafen (Bitbucket: zhafen, GitHub: zhafen)


In particular, finding the enclosed mass is quite expensive, because the distance to the center of each halo (containing at least 10 stars) is calculated for every particle of all particle types. While this was fine for FIRE-1, this can easily use more than 100 GB for a FIRE-2 simulation...

Options I can think of...

  1. Try to make my algorithm use less memory.
  2. Maybe use AHF to calculate it somehow (AHF is built for this stuff after all).
  3. Choose a different velocity scale. The dispersion seems to agree quite well with Vc(Rgal), and is physically motivated.

zhafen commented 6 years ago

Original comment by Zachary Hafen (Bitbucket: zhafen, GitHub: zhafen)


I did option 1, with surprising success! What I did was to break the enclosed mass calculation into smaller chunks, such that we didn't find the distance to each halo for as many particles at once. This uses a lot less memory, at the cost of only memory_mode_divisions = 30 more python loops, which is really not many.