Elmar Westphal , Segun Goh , Roland G. Winkler , Gerhard Gompper
{"title":"HTMPC:一个大量模板化的c++库,用于使用多粒子碰撞动力学进行大规模基于粒子的中尺度流体动力学模拟","authors":"Elmar Westphal , Segun Goh , Roland G. Winkler , Gerhard Gompper","doi":"10.1016/j.cpc.2024.109494","DOIUrl":null,"url":null,"abstract":"<div><div>We present HTMPC, a Heavily Templated C++ library for large-scale simulations implementing multi-particle collision dynamics (MPC), a particle-based mesoscale hydrodynamic simulation method. The implementation is plugin-based, and designed for distributed computing over an arbitrary number of MPI ranks. By abstracting the hardware-dependent parts of the implementation, we provide an identical application-code base for various architectures, currently supporting CPUs and CUDA-capable GPUs. We have examined the code for a system of more than a trillion MPC particles distributed over a few thousand MPI ranks (GPUs), demonstrating the scalability of the implementation and its applicability to large-scale hydrodynamic simulations. As showcases, we examine passive and active suspension of colloids, which confirms the extensibility and versatility of our plugin-based implementation.</div></div><div><h3>Program summary</h3><div><em>Program Title:</em> HTMPC</div><div><em>CPC Library link to program files:</em> <span><span>https://doi.org/10.17632/xnxh68zhbt.1</span><svg><path></path></svg></span></div><div><em>Licensing provisions:</em> MIT</div><div><em>Programming language:</em> C++17, CUDA C++ (optional), MPI (optional)</div><div><em>Supplementary material:</em> Supplementary Information, User Manual</div><div><em>Nature of problem:</em> Complex fluids in soft, active, and living matter are characterized by a wide range of relevant length- and time-scales, from nanometers to millimeters, and from sub-microseconds to seconds. Their dynamics is often governed by the hydrodynamics of the embedding aqueous medium. Thus, it is essential for the numerical study of such systems to develop efficient simulation techniques and highly parallel computer codes, especially when large system sizes and emergent collective behavior are considered. Several mesoscale simulation techniques have been developed in the last decades for this purpose. Multi-particle collision dynamics (MPC), a particle-based hydrodynamics simulation technique, is a promising ansatz for such an endeavor. It is also important to develop an easy-to-extend implementation, so that the code can be adapted to various soft and living matter systems as desired.</div><div><em>Solution method:</em> We develop an implementation of MPC that can exploit large-scale high-performance computing resources for hydrodynamic simulations of complex fluids. The code provides a C++ template library, which is plugin-based and can be extended by user-written plugins, implementing particles or objects interacting with the surrounding fluid. Calculations can be distributed over an arbitrary number of MPI ranks and accelerated with the current implementation supporting CUDA-capable GPUs. The code includes essential features of state-of-the-art MPC algorithms, e.g., thermostat, local angular-momentum conservation, and a variety of boundary conditions, such as periodic, no-slip (both also supporting shear flow) and slip. Simulation data can be written to and read from disk.</div><div><em>Additional comments including restrictions and unusual features:</em> The code provides an option to produce perfectly reproducible particle trajectories, independent of the MPI setup of a simulation system, as long as the underlying architecture and selected features are identical. It shows good scaling behaviors for sufficiently heavy workloads even for very large problems utilizing thousands of GPUs.</div></div>","PeriodicalId":285,"journal":{"name":"Computer Physics Communications","volume":"309 ","pages":"Article 109494"},"PeriodicalIF":3.9000,"publicationDate":"2025-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"HTMPC: A heavily templated C++ library for large scale particle-based mesoscale hydrodynamics simulations using multiparticle collision dynamics\",\"authors\":\"Elmar Westphal , Segun Goh , Roland G. Winkler , Gerhard Gompper\",\"doi\":\"10.1016/j.cpc.2024.109494\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><div>We present HTMPC, a Heavily Templated C++ library for large-scale simulations implementing multi-particle collision dynamics (MPC), a particle-based mesoscale hydrodynamic simulation method. The implementation is plugin-based, and designed for distributed computing over an arbitrary number of MPI ranks. By abstracting the hardware-dependent parts of the implementation, we provide an identical application-code base for various architectures, currently supporting CPUs and CUDA-capable GPUs. We have examined the code for a system of more than a trillion MPC particles distributed over a few thousand MPI ranks (GPUs), demonstrating the scalability of the implementation and its applicability to large-scale hydrodynamic simulations. As showcases, we examine passive and active suspension of colloids, which confirms the extensibility and versatility of our plugin-based implementation.</div></div><div><h3>Program summary</h3><div><em>Program Title:</em> HTMPC</div><div><em>CPC Library link to program files:</em> <span><span>https://doi.org/10.17632/xnxh68zhbt.1</span><svg><path></path></svg></span></div><div><em>Licensing provisions:</em> MIT</div><div><em>Programming language:</em> C++17, CUDA C++ (optional), MPI (optional)</div><div><em>Supplementary material:</em> Supplementary Information, User Manual</div><div><em>Nature of problem:</em> Complex fluids in soft, active, and living matter are characterized by a wide range of relevant length- and time-scales, from nanometers to millimeters, and from sub-microseconds to seconds. Their dynamics is often governed by the hydrodynamics of the embedding aqueous medium. Thus, it is essential for the numerical study of such systems to develop efficient simulation techniques and highly parallel computer codes, especially when large system sizes and emergent collective behavior are considered. Several mesoscale simulation techniques have been developed in the last decades for this purpose. Multi-particle collision dynamics (MPC), a particle-based hydrodynamics simulation technique, is a promising ansatz for such an endeavor. It is also important to develop an easy-to-extend implementation, so that the code can be adapted to various soft and living matter systems as desired.</div><div><em>Solution method:</em> We develop an implementation of MPC that can exploit large-scale high-performance computing resources for hydrodynamic simulations of complex fluids. The code provides a C++ template library, which is plugin-based and can be extended by user-written plugins, implementing particles or objects interacting with the surrounding fluid. Calculations can be distributed over an arbitrary number of MPI ranks and accelerated with the current implementation supporting CUDA-capable GPUs. The code includes essential features of state-of-the-art MPC algorithms, e.g., thermostat, local angular-momentum conservation, and a variety of boundary conditions, such as periodic, no-slip (both also supporting shear flow) and slip. Simulation data can be written to and read from disk.</div><div><em>Additional comments including restrictions and unusual features:</em> The code provides an option to produce perfectly reproducible particle trajectories, independent of the MPI setup of a simulation system, as long as the underlying architecture and selected features are identical. It shows good scaling behaviors for sufficiently heavy workloads even for very large problems utilizing thousands of GPUs.</div></div>\",\"PeriodicalId\":285,\"journal\":{\"name\":\"Computer Physics Communications\",\"volume\":\"309 \",\"pages\":\"Article 109494\"},\"PeriodicalIF\":3.9000,\"publicationDate\":\"2025-04-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Computer Physics Communications\",\"FirstCategoryId\":\"101\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S001046552400417X\",\"RegionNum\":2,\"RegionCategory\":\"物理与天体物理\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"2025/1/8 0:00:00\",\"PubModel\":\"Epub\",\"JCR\":\"Q1\",\"JCRName\":\"COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computer Physics Communications","FirstCategoryId":"101","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S001046552400417X","RegionNum":2,"RegionCategory":"物理与天体物理","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2025/1/8 0:00:00","PubModel":"Epub","JCR":"Q1","JCRName":"COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS","Score":null,"Total":0}
引用次数: 0
摘要
我们提出了HTMPC,一个重度模板化的c++库,用于实现多粒子碰撞动力学(MPC)的大规模模拟,这是一种基于粒子的中尺度流体动力学模拟方法。该实现是基于插件的,设计用于在任意数量的MPI排名上进行分布式计算。通过抽象实现的硬件相关部分,我们为各种架构提供了相同的应用程序代码基础,目前支持cpu和cuda功能的gpu。我们已经检查了超过一万亿个MPC粒子分布在几千个MPI等级(gpu)的系统的代码,展示了实现的可扩展性及其对大规模流体动力学模拟的适用性。作为演示,我们检查了胶体的被动悬浮和主动悬浮,这证实了我们基于插件的实现的可扩展性和多功能性。程序摘要程序标题:HTMPCCPC库链接到程序文件:https://doi.org/10.17632/xnxh68zhbt.1Licensing规定:mit编程语言:c++ 17, CUDA c++(可选),MPI(可选)补充材料:补充信息,用户手册问题的性质:复杂的流体在软,活性和生活物质的特点是广泛的相关长度和时间尺度,从纳米到毫米,从亚微秒到秒。它们的动力学通常受包埋水介质的流体动力学的支配。因此,开发高效的模拟技术和高度并行的计算机代码对于此类系统的数值研究至关重要,特别是当考虑大系统规模和紧急集体行为时。在过去的几十年里,为此目的发展了几种中尺度模拟技术。多粒子碰撞动力学(MPC)是一种基于粒子的流体力学模拟技术,是解决这一问题的一种很有前途的方法。开发易于扩展的实现也很重要,这样代码就可以根据需要适应各种软的和有生命的系统。解决方法:我们开发了一种MPC的实现,可以利用大规模的高性能计算资源进行复杂流体的流体动力学模拟。该代码提供了一个基于插件的c++模板库,可以通过用户编写的插件进行扩展,实现粒子或对象与周围流体的交互。计算可以分布在任意数量的MPI排名上,并使用当前支持cuda功能gpu的实现进行加速。该代码包括最先进的MPC算法的基本特征,例如,恒温器,局部角动量守恒,以及各种边界条件,如周期性,无滑移(也支持剪切流)和滑移。模拟数据可以写入和读取磁盘。附加注释,包括限制和不寻常的功能:只要底层架构和选择的功能相同,该代码提供了一个选项,以产生完全可复制的粒子轨迹,独立于模拟系统的MPI设置。对于足够繁重的工作负载,甚至对于使用数千个gpu的非常大的问题,它都显示出良好的伸缩行为。
HTMPC: A heavily templated C++ library for large scale particle-based mesoscale hydrodynamics simulations using multiparticle collision dynamics
We present HTMPC, a Heavily Templated C++ library for large-scale simulations implementing multi-particle collision dynamics (MPC), a particle-based mesoscale hydrodynamic simulation method. The implementation is plugin-based, and designed for distributed computing over an arbitrary number of MPI ranks. By abstracting the hardware-dependent parts of the implementation, we provide an identical application-code base for various architectures, currently supporting CPUs and CUDA-capable GPUs. We have examined the code for a system of more than a trillion MPC particles distributed over a few thousand MPI ranks (GPUs), demonstrating the scalability of the implementation and its applicability to large-scale hydrodynamic simulations. As showcases, we examine passive and active suspension of colloids, which confirms the extensibility and versatility of our plugin-based implementation.
Program summary
Program Title: HTMPC
CPC Library link to program files:https://doi.org/10.17632/xnxh68zhbt.1
Licensing provisions: MIT
Programming language: C++17, CUDA C++ (optional), MPI (optional)
Supplementary material: Supplementary Information, User Manual
Nature of problem: Complex fluids in soft, active, and living matter are characterized by a wide range of relevant length- and time-scales, from nanometers to millimeters, and from sub-microseconds to seconds. Their dynamics is often governed by the hydrodynamics of the embedding aqueous medium. Thus, it is essential for the numerical study of such systems to develop efficient simulation techniques and highly parallel computer codes, especially when large system sizes and emergent collective behavior are considered. Several mesoscale simulation techniques have been developed in the last decades for this purpose. Multi-particle collision dynamics (MPC), a particle-based hydrodynamics simulation technique, is a promising ansatz for such an endeavor. It is also important to develop an easy-to-extend implementation, so that the code can be adapted to various soft and living matter systems as desired.
Solution method: We develop an implementation of MPC that can exploit large-scale high-performance computing resources for hydrodynamic simulations of complex fluids. The code provides a C++ template library, which is plugin-based and can be extended by user-written plugins, implementing particles or objects interacting with the surrounding fluid. Calculations can be distributed over an arbitrary number of MPI ranks and accelerated with the current implementation supporting CUDA-capable GPUs. The code includes essential features of state-of-the-art MPC algorithms, e.g., thermostat, local angular-momentum conservation, and a variety of boundary conditions, such as periodic, no-slip (both also supporting shear flow) and slip. Simulation data can be written to and read from disk.
Additional comments including restrictions and unusual features: The code provides an option to produce perfectly reproducible particle trajectories, independent of the MPI setup of a simulation system, as long as the underlying architecture and selected features are identical. It shows good scaling behaviors for sufficiently heavy workloads even for very large problems utilizing thousands of GPUs.
期刊介绍:
The focus of CPC is on contemporary computational methods and techniques and their implementation, the effectiveness of which will normally be evidenced by the author(s) within the context of a substantive problem in physics. Within this setting CPC publishes two types of paper.
Computer Programs in Physics (CPiP)
These papers describe significant computer programs to be archived in the CPC Program Library which is held in the Mendeley Data repository. The submitted software must be covered by an approved open source licence. Papers and associated computer programs that address a problem of contemporary interest in physics that cannot be solved by current software are particularly encouraged.
Computational Physics Papers (CP)
These are research papers in, but are not limited to, the following themes across computational physics and related disciplines.
mathematical and numerical methods and algorithms;
computational models including those associated with the design, control and analysis of experiments; and
algebraic computation.
Each will normally include software implementation and performance details. The software implementation should, ideally, be available via GitHub, Zenodo or an institutional repository.In addition, research papers on the impact of advanced computer architecture and special purpose computers on computing in the physical sciences and software topics related to, and of importance in, the physical sciences may be considered.