Tools
Explore new features and tools within Intel® products, communities, and platforms
83 Discussions

GROMACS*: Simulate and Analyze Proteins, Lipids and Acids Powered by SYCL*

Rob_Mueller-Albrecht
1 0 4,820

I would like to introduce another ready-to-use SYCL*-enabled scientific software package in this blog. GROMACS* is an open-source, high-performance molecular dynamics package primarily used for biomolecular simulations, accounting for approximately five percent of high-performance computing (HPC) use worldwide. Due to the extreme computing needs of molecular dynamics, significant efforts are invested in improving the performance and scalability of simulations.  

Prof. Erik Lindahl and his colleagues Andrey Alekseenko and Szilárd Páll at the KTH Royal Institute of Technology in Stockholm, Sweden, have been at the forefront of SYCL and oneAPI adoption with their embrace of the open standards-based, cross-architecture, cross-vendor oneAPI programming model for GROMACS. They and the Swedish e-Science Research Center (SeRC) have been a oneAPI Center of Excellence since the summer of 2020. In the process, they increased the number and types of computing devices biomolecular simulations can be executed on by moving beyond the device restrictions of CUDA*.

About GROMACS

GROMACS is a community-driven open source project with many contributors from all over the world. Current project leaders are Berk Hess (KTH-Royal Institute of Technology, SE) and Erik Lindahl (Stockholm University and KTH-Royal Institute of Technology, SE). The adoption of SYCL by such a crucial science project demonstrates the strength of support that SYCL has from the community.

Its primary purpose is to calculate the interactions within biochemical molecules like proteins, lipids, and nucleic acids with many complex bonds. Still, since GROMACS is extremely fast at calculating the nonbonded interactions (that usually dominate simulations), many groups are also using it for research on non-biological systems, for example, polymers and fluid dynamics.

At its core, it is an engine for molecular dynamics simulation and energy minimization, applying computational techniques to describe, understand, and predict the macroscopic behavior of chemical systems based on our understanding of atomic models. The knowledge gained through these techniques can be used to design new materials and accurately anticipate their properties.

Both static (equilibrium) and dynamic (non-equilibrium) properties can be modeled to predict binding force, viscosity, diffusion behavior, propagation of disturbances throughout a crystal lattice, and much more.

GROMACS provides a rich toolbox of methods that can be scaled to take full advantage of the computational environment available up to heavily distributed exascale supercomputers. Everything from periodic boundary conditions, force computations, temperature- and pressure coupling to stochastic or browning dynamics are covered. For a full list of available algorithms, please check the GROMACS Reference Manual here.

In 2021, the GROMACS project shifted focus to SYCL, a modern C++ API, as a portable GPU backend. SYCL became the preferred backend to support AMD and Intel GPUs in 2022. In GROMACS 2023, SYCL has near-full feature parity with the CUDA backend and can be used with all recent AMD and Intel GPUs. Heterogeneous parallelization and GPU acceleration have become central tenets of software development for the GROMACS project.

The oneAPI Center of Excellence

The Academic oneAPI Center of Excellence at the Swedish e-Science Research Center (SeRC) is a collaboration of scientists at SeRC, KTH Royal Institute of Technology (KTH), and Stockholm University (SU).

As project leader for the international GROMACS molecular simulation project, Erik Lindahl, Professor of Biophysics at KTH & SU, spearheads the effort to bring SYCL and oneAPI’s vision of an open, cross-industry, standards-based, unified, multiarchitecture, multi-vendor programming model to GROMACS. He and his colleagues Andrey Alekseenko and Szilárd Páll are uniquely positioned to accelerate the adoption of open programming frameworks free from vendor-lock by the open source scientific computing community. They have been bringing SYCL to the GROMACS code base for the last 2 years to the point where it is now, exploiting parallelism on all levels, from GPU and accelerator offload to distributed computing.

 

Download the latest GROMACS distribution with SYCL support:

Watch and listen to Erik Lindahl’s perspective on

 

 

adobestock-171997559.jpg

Porting GROMACS to SYCL

Erik and Andrey have given a series of talks and have published several papers on their experience adding support for the SYCL platform into the established GROMACS codebase and considerations for C++ software stack porting and optimization using SYCL. SYCL is an organic extension of C++17 and newer ISO standards employing a single-source model for multiple vendors. In addition to being the primary accelerated compute programming framework for Intel GPUs, the open backend architecture of oneAPI allows it to target a range of GPUs and 

accelerators from different vendors. SYCL 2020 even supports interoperability, permitting encapsulation of proprietary native hardware APIs from AMD, NVIDIA, and others as a means to define a compromise between having a common hardware-agnostic single source framework and a hardware-optimized backend.

Supporting multiple GPU platforms presents the challenge of balancing performance (low-level and hardware-specific code) and maintainability (more generalization and code reuse).

You also need to take different workstream, dispatch, and task queueing philosophies, as well as memory buffer and shared memory models, into account. All this while ensuring to trust the GPU runtimes and lower-level backend to make the crucial optimization decisions for you.

Erik provides a summary of the oneAPI optimization decision processes and considerations in his talk:

 

Andrey Alekseenko, Szilárd Páll, and Erik Lindahl. 2021. Experiences With Adding SYCL Support to GROMACS.

In International Workshop on OpenCL (IWOCL’21), April 27–29, 2021, Munich, Germany. ACM, New York, NY, USA

https://doi.org/10.1145/3456669.3456690

 

Bringing Choice to Accelerated Compute

Become part of the effort to make high-performance cross-architecture compute transparent, portable, and flexible. Include SYCL as the accelerator and GPU offload solution in your code path. Adopt oneAPI as the means to implementations free from vendor lock.

The Intel® DPC++ Compatibility Tool and the CUDA to C++ with SYCL Migration Portal are the convenient starting point for your own migration to SYCL.

Make SYCL part of your software solution.

SYCL Resources

GROMACS Resources

 

Notices and Disclaimers

Performance varies by use, configuration, and other factors. Learn more at www.Intel.com/PerformanceIndex. Results may vary.

Performance results are based on testing as of dates shown in configurations and may not reflect all publicly available updates. No product or component can be absolutely secure.

Your costs and results may vary.

Intel technologies may require enabled hardware, software or service activation.

Intel does not control or audit third-party data. You should consult other sources to evaluate accuracy.

© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries.

*Other names and brands may be claimed as the property of others.

 

About the Author
Rob enables developers to streamline programming efforts across multiarchitecture compute devices for high performance applications taking advantage of Intel's family of development tools. He has extensive 20+ years of experience in technical consulting, software architecture and platform engineering working in IoT, edge, embedded software and hardware developer enabling.