mirror of
https://github.com/DifferentiableUniverseInitiative/JaxPM.git
synced 2025-04-08 04:40:53 +00:00
clarifying why cic_paint_dx is slower
This commit is contained in:
parent
6256fbadb1
commit
2472a5d9df
1 changed files with 281 additions and 275 deletions
|
@ -244,6 +244,12 @@
|
|||
"id": "02f18b52",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"We note that **painting only displacements is slower** than painting absolute particle positions.\n",
|
||||
"\n",
|
||||
"This slower performance occurs because **painting displacements requires processing in smaller chunks or batches**. Instead of creating a large array of particle positions with neighbors (e.g., `(NParticles, 3, 8)`), which consumes a significant amount of memory, we paint the particles in manageable batches.\n",
|
||||
"\n",
|
||||
"This trade-off allows for greater memory efficiency but comes at the expense of speed. By reducing the memory footprint, we avoid memory limitations, especially useful in large-scale or distributed PM simulations, even if it means slightly slower painting.\n",
|
||||
"\n",
|
||||
"We’ll see in later notebooks that retaining only the displacement is essential for distributed Particle Mesh (PM) simulations, where memory efficiency and computational speed are key.\n"
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue