# A Domain Specific Language for Performance Portable Molecular Dynamics   Algorithms

**Authors:** William R. Saunders, James Grant, Eike H. M\"uller

arXiv: 1704.03329 · 2018-03-14

## TL;DR

This paper introduces a domain-specific language and code generation framework to develop performance portable molecular dynamics algorithms, simplifying adaptation to diverse hardware and enabling efficient simulation and analysis.

## Contribution

It presents a novel Python-based code generation system for MD simulations that ensures performance portability across various architectures, inspired by PDE abstraction approaches.

## Key findings

- Demonstrates efficient, scalable MD code on multiple hardware platforms.
- Shows ease of expressing analysis algorithms within the framework.
- Achieves performance comparable to state-of-the-art packages.

## Abstract

Developers of Molecular Dynamics (MD) codes face significant challenges when adapting existing simulation packages to new hardware. In a continuously diversifying hardware landscape it becomes increasingly difficult for scientists to be experts both in their own domain (physics/chemistry/biology) and specialists in the low level parallelisation and optimisation of their codes. To address this challenge, we describe a "Separation of Concerns" approach for the development of parallel and optimised MD codes: the science specialist writes code at a high abstraction level in a domain specific language (DSL), which is then translated into efficient computer code by a scientific programmer. In a related context, an abstraction for the solution of partial differential equations with grid based methods has recently been implemented in the (Py)OP2 library. Inspired by this approach, we develop a Python code generation system for molecular dynamics simulations on different parallel architectures, including massively parallel distributed memory systems and GPUs. We demonstrate the efficiency of the auto-generated code by studying its performance and scalability on different hardware and compare it to other state-of-the-art simulation packages. With growing data volumes the extraction of physically meaningful information from the simulation becomes increasingly challenging and requires equally efficient implementations. A particular advantage of our approach is the easy expression of such analysis algorithms. We consider two popular methods for deducing the crystalline structure of a material from the local environment of each atom, show how they can be expressed in our abstraction and implement them in the code generation framework.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1704.03329/full.md

## Figures

13 figures with captions in the complete paper: https://tomesphere.com/paper/1704.03329/full.md

---
Source: https://tomesphere.com/paper/1704.03329