Molecular dynamics simulation in hybrid systems
João Tiago Araújo da Silva · 2016
The molecular dynamics simulation is a topic fairly investigated because it solves countless problems of physics, chemistry, or biology. From the computer engineering point of view it is an interesting case study because it is a computationally complex problem. The complexity arises when there are a high number of particles, thereby resulting in a high number of iterations to compute on each iteration. Presently there are systems with millions of particles that need to be simulated in the shortest time possible. This led to the development of molecular dynamics packages that attempt to use all the resources available to improve the execution of simulations. The main goal of this thesis is to run efficiently molecular dynamics simulations on hybrid systems. Instead of starting a molecular dynamics implementation from scratch, it was used the MOIL package. Then it was developed an implementation based on MOIL with optimizations that allow the code to be automatically vectorized by the compiler. These optimizations focused on the calculation of forces and the data structures. New data structures were introduced to decompose the simulation domain into cells. The vectorization was used both in sequential and parallel implementations. In both cases, vectorization allowed a higher performance when used with cells. In order to achieve the best possible performance, the optimized code has been parallelized using different strategies, including shared memory, distributed memory, and a hybrid solution. In the execution of the parallel code several combinations of processes and threads were tested. Among all the developed versions, the one that achieved the best performance was the hybrid version. All implementations were compared to Gromacs, the reference in terms of performance of the molecular dynamics simulation.