Mercury-Opal: the GPU-accelerated version of the n-body code for planet formation Mercury-Ar χ \chi es Journal: Astronomy & \& Computing
Paolo Matteo Simonetti, Diego Turrini, Romolo Politi, Scigé J. Liu, Sergio Fonte, Danae Polychroni, Stavro Lambrov Ivanovski · 2026
Read Mercury-Opal: the GPU-accelerated version of the n-body code for planet formation Mercury-Ar χ \chi es Journal: Astronomy & \& Computing by Paolo Matteo Simonetti, Diego Turrini, Romolo Politi, Scigé J. Liu, Sergio Fonte, Danae Polychroni, Stavro Lambrov Ivanovski (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-19654.txt.
Introduction
Paolo Matteo Simonetti and six colleagues speed up the computer models used to study how planets form. Planet formation is tracked with n-body codes, which follow many objects pulling on each other by gravity. Fully interacting simulations are the next frontier, but they are brutally expensive to run. The team presents Mercury-Opal, a version of a known code rebuilt for graphics processors.
Graphics processors run many simple calculations at once, which suits gravity between many bodies. Moving the code to them should let researchers follow larger systems for longer times. Mercury-Arches, the parent code, is a standard tool in the field. A faster version opens studies that were out of reach. The paper describes the port and what it enables.
Catalog record
| CREATOR | Paolo Matteo Simonetti, Diego Turrini, Romolo Politi, Scigé J. Liu, Sergio Fonte, Danae Polychroni, Stavro Lambrov Ivanovski |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 44 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2601-19654
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Mercury-Opal: the GPU-accelerated version of the n-body code for planet formation Mercury-Ar χ \chi es Journal: Astronomy & \& Computing Paolo Matteo Simonetti, Diego Turrini, Romolo Politi, Scigé J. Liu, Sergio Fonte, Danae Polychroni, Stavro Lambrov Ivanovski Abstract Large n-body simulations with fully interacting objects represent the next frontier in computational planetary formation studies. In this paper, we present Mercury-Opal , the GPU-accelerated version of the n-body planet formation code Mercury-Ar χ \chi es . The porting to GPU computing has been performed through OpenACC to ensure cross-platform support and minimize the code restructuring efforts while retaining most of the performance increase expected from GPU computing. We tested Mercury-Opal against its parent code Mercury-Ar χ \chi es under conditions that put GPU computing at disadvantage and nevertheless show how the GPU-based execution provides advantages with respect to CPU-serial execution even for limited computational loads. 1 Introduction Mercury ( 4 ) is a general purpose n-body integrator widely used in the planetary and exoplanetary science communities. At the time of writing, Mercury has been used in more than 1600 studies and has served as the basis for multiple specialized codes that expanded its modeling capabilities by introducing new physical processes such as spin-orbit interaction ( 9 , SMERCURY, ) , tides ( 1 , Mercury-T, ) , the interaction between planetary bodies and their native protoplanetary disk ( Mercury-Ar \chi es , 21 ; 23 , see also Turrini et al., this issue) and the Yarkovsky-O’Keefe-Radzievskii-Paddack effect ( 6 ) . The main limiting factor to the scientific use of Mercury , shared by all n-body codes, is the number of planetary bodies that can be modeled, which is constrained by the computational efficiency of the adopted dynamical algorithm, the timescale of the problem to be modeled and, above all, the available computational resources. The growth of computing power supplied by multi-cores architectures offered the possibility for increasingly detailed simulations and boosted the transition of n-body codes to parallel programming, e.g. REBOUND ( 16 ) , PKDGRAV3 ( 15 ) , Mercury-Ar \chi es ( 21 ; 23 ) . As a result, while studies at the turn of the century could include either \sim 10^{2} bodies integrated for 10^{8} years ( 3 ; 5 , e.g.) , or \sim 10^{6} bodies integrated for just 10^{3} years ( 18 ) , current calculations can integrate 10^{5} bodies for up to 10^{7} years ( 25 ) . GPU accelerators constitute the next iteration of this approach, as they increase both the computational density and energy efficiency ( 14 ) while decreasing the hardware cost on a per-operation basis. Example of existing GPU-parallel n-body codes are HiGPU ( 2 ) , GENGA ( 8 ) and GENGA II ( 7 ) , and GLISSE ( 26 ) . The effective use of GPUs requires careful data management to comply with the more stringent limits of the GPU’s internal RAM and the limits in the data transfer bandwidth between CPU ( host ) and GPU ( device ). The transfer of data and instructions between host and device and the parallel execution of sections of codes on GPUs can be achieved in three main ways. The first one is via a low-level programming application interface (API) like OpenCL 1 1 1 https://www.khronos.org/opencl/ , CUDA 2 2 2 https://docs.nvidia.com/cuda/ , HIP 3 3 3 https://rocm.docs.amd.com/projects/HIP/en/latest/ or SYCL 4 4 4 https://www.khronos.org/sycl/ . The second one is via high-level compiler directives such as OpenACC 5 5 5 https://www.openacc.org/ and OpenMP 6 6 6 https://www.openmp.org/ . The third one is via specific abstraction libraries, for example Kokkos 7 7 7 https://kokkos.org/kokkos-core-wiki/ , Raja 8 8 8 https://github.com/LLNL/RAJA , Thrust 9 9 9 https://developer.nvidia.com/thrust or the C++ Parallel Standard Template Library (PSTL) 10 10 10 https://www.intel.com/content/www/us/en/developer/articles/guide/get-started-with-parallel-stl.html . Each approach differs in what hardware components they target and how much finer control they allow to or require from users, its portability and how much code restructuring they mandate in general. In particular, OpenACC offers two advantages that we decided to leverage on for this work. The first is the minimization of deep code restructuring, associated with the use of compiler directives. The second one is its better performances and slightly more precise control granted to the user with respect to the competing OpenMP solution. In this paper, we present the porting to GPU computing of Mercury-Ar \chi es ( 21 ; 23 , see also Turrini et al., this issue) , a parallel n-body planet formation code built on top of Mercury , which has been carried on under the OpenACC 3.3 specification 11 11 11 https://www.openacc.org/sites/default/files/inline-images/Specification/OpenACC-3.3-final.pdf . This GPU-capable version of Mercury-Ar \chi es , which is called Mercury-Opal , has been developed in the context of the Origins of Primordial Atmospheres for arieL (OPAL, Polychroni et al., this issue) Key Science Project of the Italian National Centre for HPC, Big Data and Quantum Computing (ICSC) with the goal of providing the community working on the preparation of the ESA Ariel mission ( 19 ; 22 ; 24 ) with a physically realistic and efficient n-body integrator for formation-to-observation simulation campaigns. The structure of this paper is as follows: in Sect. 2 we present the salient features of the parent code and its profiling; in Sect. 3 we delineate the parallelization strategy and show pseudocode blocks of the main loops ported on GPU; in Sect. 4 we show the results in terms of performance and accuracy; in Sect. 5 we briefly discuss our choices in terms of parallelization framework; finally, in Sect. 6 we identify the main areas of improvement and our future plans. 2 The Mercury-Ar \chi es code Figure 1: The general structure of the Mercury-Ar \chi es code. The left hand column represent the logical structure of the code, while the right hand column reports the names of the main subroutines involved in the computation. Higher level subroutines are reported in blue and red. 2.1 Main features of the model The starting point of our parallelization effort is Mercury-Ar \chi es ( 21 ; 23 , Turrini et al., this issue) . This version of Mercury has been designed to study the dynamical evolution over Myr-long timescales of forming planetary systems embedded within their native protoplanetary disk. Mercury-Ar \chi es is a multi-language code that combines Fortran, specifically the FORTRAN77 standard of Mercury and the Fortran95 of the Ar \chi es library, and C in the form the C99 library WHFAST ( 17 ) . The most important advancements, in terms of the physical recipes, introduced by Mercury-Ar \chi es with respect to Mercury are: 1. a faster and more accurate subroutine for the keplerian position and velocity propagation of the bodies in the gravity well of the parent star (called keplerian drift ), which takes advantage of the WHFAST library ( 17 ) ; 2. the evolution in mass, physical radius and semimajor axis of forming and migrating planets; 3. the gravitational interaction between the protoplanetary disk and the planetesimals embedded in it; 4. the non-gravitational interaction exerted by the gas in the protoplanetary disk and the planetesimals through aerodynamic drag. Mercury-Ar \chi es has also been parallelized on CPU via the inclusion of