Optimize track vector data layout for particle types #1312
Labels
performance
Changes for performance optimization
physics
Particles, processes, and stepping algorithms
I have another optimization idea related to sorting but maybe less intrusive, along the lines of how AdePT has separate state vectors for each particle type. To do something similar, what about we instantiate charged and neutral particles at opposite ends of the state vector? This will naturally partition them to some extent (though we'd need to consider cases like annihilation and pair production, where the track slot basically changes type, and how to handle when the two stacks meet in the middle). We don't have to worry about "mixing" breaking anything due to how we launch kernels.
@amandalund suggested sorting the last
num_vacancies
track initializers by particle type before initializing which should be equivalent.I think there has to be an additional toggle between "filling" and "filled": that suggestion would work during the "filled" stage but we'd still have to push to opposite ends of the vector while filling.
See related work from AdePT: https://cds.cern.ch/record/2856531
The text was updated successfully, but these errors were encountered: