arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2105.00057physics.comp-phcs.DS
收藏

通过动态收集数据结构加速基于Python的拉格朗日流体流粒子模拟

Speeding up Python-based Lagrangian Fluid-Flow Particle Simulations via Dynamic Collection Data Structures

Christian Kehl, Erik van Sebille, Angus Gibson

摘要:

在Python的科学计算生态系统中广泛建立了类似数组的集合数据结构,用于高性能计算。该结构很好地映射到物理学和地球科学中常见的计算问题的规则网格晶格结构。然而,高性能只保证静态计算与固定的计算域。我们表明,对于一个活跃变化的计算域中的动态计算,NumPy及其衍生物提供的类似数组的集合是大型计算的瓶颈。作为回应,我们描述了将自然动态集合数据结构(例如双向链表)集成到NumPy模拟和基于\textit{ctypes}的C绑定中。我们的基准测试验证和量化的性能提高归因于收集数据结构的变化。我们的应用场景,拉格朗日(海洋)流体流动粒子模拟的\textit{Parcels}框架内,演示了在现实环境中的加速产量,并展示了新的功能,促进了优化的收集数据结构。

英文摘要:

Array-like collection data structures are widely established in Python's scientific computing-ecosystem for high-performance computations. The structure maps well to regular, gridded lattice structures that are common to computational problems in physics and geosciences. High performance is, however, only guaranteed for static computations with a fixed computational domain. We show that for dynamic computations within an actively changing computational domain, the array-like collections provided by NumPy and its derivatives are a bottleneck for large computations. In response, we describe the integration of naturally-dynamic collection data structures (e.g. double-linked lists) into NumPy simulations and \textit{ctypes}-based C-bindings. Our benchmarks verify and quantify the performance increase attributed to the change of the collection data structure. Our application scenario, a Lagrangian (oceanic) fluid-flow particle simulation within the \textit{Parcels} framework, demonstrates the speed-up yield in a realistic setting and demonstrates the novel capabilities that are facilitated by optimised collection data structures.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑