The HECToR Service is now closed and has been superceded by ARCHER.

Molecular Dynamics Simulation of Multi-Scale Flows on GPUs

There are considerable technological opportunities in engineering devices at the micro or nano scale. At these very small scales, engineering design often requires understanding the behaviour and interactions of the actual molecules within and around the devices. The computational tool needed for this is Molecular Dynamics (MD), but running engineering time- and length-scale MD simulations entails considerable computational effort that currently hinders transformational advances in micro and nano engineering. The premise of this project is that if we can use the power of new Graphics Processing Units (GPUs) to accelerate the MD calculations, then we may be one step closer to enabling the faster and longer simulations that are needed. Not only does running simulations on GPUs relieve existing, CPU-based, high-performance computational resources, but it also enables simulations to be run on personal workstations equipped with suitable GPUs, thereby saving on large CPU-cluster waiting times and execution costs.

In order to harness the computational power of GPUs, the aim of this project was to integrate the Molecular Fluid-Dynamics simulation package OpenFOAM with the molecular-modelling library OpenMM. The reason for integration, rather than a straightforward substitution of OpenFOAM with OpenMM, was to combine the pre- and post-processing functionality of OpenFOAM (running on CPUs) with fast, GPU-based, implementation of Molecular Dynamics provided by OpenMM. The result was a GPU-accelerated Molecular Fluid Dynamics simulation package with a pre- and post-processing capability.

The following objectives have been achieved during the project. The initial OpenMM-CUDA-based hybrid solver was replaced with an equivalent OpenCL-based hybrid solver. The OpenCL-based solver consisted of the pairwise force calculation implemented on the OpenMM-OpenCL GPU platform and the remainder of the MD Algorithm implemented in OpenFOAM and running on the CPU platform. The GPU capability of the hybrid solver was then extended to include particle trajectory integration, various fluid-dynamic measurement and control tools and the additional functionality in the form of fine-grained measurement and control. The new code was benchmarked on the ARCHIE-West cluster during the stages of development. The CPUs used in the tests were Intel Xeon X5650 2.66 GHz CPUs (available in ARCHIE-WeSt) and the GPU was the NVidia Tesla M2075 with 6GB GDDR5 and 448 processing cores (also available in ARCHIE-WeSt).

  • Computational efficiency of the solver varied throughout the different stages of development. The initial step of replacing the CUDA-based solver with an OpenCL alternative resulted in a hybrid solver that was 2.2-times faster than the CUDA version and that rivalled the performance of 58 CPU cores.
  • With the addition of particle trajectory integration, the computational performance increased to match that of 79 CPU cores.
  • The addition of measurements and control decreased the performance somewhat, in particular the fine-grained measurement and control, which resulted in a hybrid solver competing with 63 CPU cores.
  • Following further validation and testing, the new code will be released as an open source package on GitHub (late 2013).

Please see PDF or HTML for a report which summarises this project.