We have developed BiosimMD.jl, a package for performing molecular dynamics (MD) simulations significantly faster than state-of-the-art engines. We present performance benchmarks of the package and its versatility. The package allows scientists to implement novel methods for MD without compromising the speed of simulation. We also discuss aspects of Julia critical in BiosimMD’s development, including access to many levels of computational abstraction, metaprogramming, and ease of multi-threading.
Molecular dynamics (MD) is a computational method for simulating microscopic motions of atoms in a system, in order to understand macroscopic properties of the system. One of the main uses of MD is in computational drug discovery, where simulating a target protein with a candidate drug (ligand) allows one to predict their binding affinity before conducting expensive wet-lab experiments. MD computations are by no means cheap: to get meaningful results multi-day simulations on high-performance machines are often necessary. For that reason, most popular MD engines are written and performance engineered in C++ in order to make best use of the hardware.
BiosimMD.jl is wholly written in Julia, which made it possible to match and surpass the performance of state-of-the-art C++ engines. The package makes extensive use of the ability to access low-level compiler and CPU features e.g. SIMD operations. At the same time, the ability to test new algorithms at a high level made it possible to quickly research and prototype the best performing code. The package also heavily relies on Julia’s metaprogramming, greatly reducing the size and the complexity of the codebase.
The design of BiosimMD.jl enables users to implement custom MD methods without compromising simulation speed and modifying BiosimMD’s internal code. One example is the use of machine learning during the simulation on-the-fly. A challenge in MD is the design of high-quality force-fields, the set of parameters that determines how the atoms move in a simulation. While there are good off-the-shelf force-fields for proteins, that is not the case for ligands (candidate drugs). We have implemented a package, MoleculeMD.jl, which integrates with BiosimMD.jl in a few lines of code, providing a machine-learnt force field trained on accurate and extensive quantum chemistry data. BiosimMD.jl provides an interface for implementing a wide array of similar techniques.
Currently, BiosimMD.jl is implemented and optimized for Intel and AMD CPUs. In future, a GPU implementation will also be available. There is also an accompanying package to import molecular systems from popular MD engines such as Gromacs and OpenMM.