Schnek: A C++ library for the development of parallel simulation codes on regular grids
收藏资源简介:
A large number of algorithms across the field of computational physics are formulated on grids with a regular topology. We present Schnek, a library that enables fast development of parallel simulations on regular grids. Schnek contains a number of easy-to-use modules that greatly reduce the amount of administrative code for large-scale simulation codes. The library provides an interface for reading simulation setup files with a hierarchical structure. The structure of the setup file is translated into a hierarchy of simulation modules that the developer can specify. The reader parses and evaluates mathematical expressions and initialises variables or grid data. This enables developers to write modular and flexible simulation codes with minimal effort. Regular grids of arbitrary dimension are defined as well as mechanisms for defining physical domain sizes, grid staggering, and ghost cells on these grids. Ghost cells can be exchanged between neighbouring processes using MPI with a simple interface. The grid data can easily be written into HDF5 files using serial or parallel I/O.
计算物理学领域中的大量算法均基于规则拓扑网格构建。我们推出Schnek库,该库可助力快速开发面向规则网格的并行模拟程序。该库内置多个易用模块,可大幅缩减大规模模拟代码所需的管理类代码体量。此库提供了读取层级结构模拟配置文件的接口,配置文件的结构会被转换为开发者可自定义的模拟模块层级体系。该读取器可解析并求值数学表达式,同时完成变量或网格数据的初始化。这使得开发者能够以极低的开发成本编写模块化且灵活性优异的模拟代码。库中支持任意维度的规则网格定义,同时提供了配置物理域尺寸、网格交错排布以及此类网格上幽灵单元(ghost cells)的相关机制。相邻进程间可通过简洁接口利用MPI(Message Passing Interface)实现幽灵单元的数据交换。网格数据可通过串行或并行I/O(Input/Output)轻松写入HDF5文件。




