This paper proposes an improved particle neighbor search algorithm,focusing on optimizing computational efficiency and memory usage in large-scale particle system simulations.By partitioning the simulation space into ...This paper proposes an improved particle neighbor search algorithm,focusing on optimizing computational efficiency and memory usage in large-scale particle system simulations.By partitioning the simulation space into grids and combining it with Morton encoding,it ensures that adjacent grids are stored contiguously in memory,thereby enhancing the locality of data access and reducing the probability of cache misses.In the particle sorting phase,Morton encoding is used to rearrange the particles,further enhancing memory continuity and leveraging the hardware cache's prefetching mechanism to reduce data read latency.The algorithm also incorporates the idea of the Verlet table method by setting a sorting threshold to optimize the sorting process,avoiding redundant calculations and unnecessary sorting operations.Through the above optimization methods,a multi-level cache optimization strategy is achieved,significantly improving the algorithm's performance and memory utilization efficiency.Experimental results show that the algorithm proposed in this paper has significant advantages in large-scale particle simulations.展开更多
基金support by the National Key Research and Development Project of China,the Ministry of Science and Technology of China(Project No.2023YFC3007203)the National Science and Technology Major Project of China,the Ministry of Science and Technology of China(Project No.2025ZD0122005)the National Natural Science Foundation of China(Nos.41172116 and U1261212)is gratefully acknowledged.
文摘This paper proposes an improved particle neighbor search algorithm,focusing on optimizing computational efficiency and memory usage in large-scale particle system simulations.By partitioning the simulation space into grids and combining it with Morton encoding,it ensures that adjacent grids are stored contiguously in memory,thereby enhancing the locality of data access and reducing the probability of cache misses.In the particle sorting phase,Morton encoding is used to rearrange the particles,further enhancing memory continuity and leveraging the hardware cache's prefetching mechanism to reduce data read latency.The algorithm also incorporates the idea of the Verlet table method by setting a sorting threshold to optimize the sorting process,avoiding redundant calculations and unnecessary sorting operations.Through the above optimization methods,a multi-level cache optimization strategy is achieved,significantly improving the algorithm's performance and memory utilization efficiency.Experimental results show that the algorithm proposed in this paper has significant advantages in large-scale particle simulations.