Sometimes you find simulations being ported to a supercomputer, while they can actually run on a laptop. ESA found that one of their simulation software was getting more demanding, but wanted to keep it running on their work laptops. Read how we ported ESA’s MAPPS project to multicore CPU and GPU with OpenCL.
About the customer

The European Space Agency (ESA) is an international organization dedicated to the peaceful exploration of space. It coordinates the design, development, and launch of satellites, space probes, and human spaceflight missions. Furthermore, it manages critical infrastructure for global climate monitoring, navigation systems (like Galileo), and foundational scientific research that expands our understanding of the universe.
The challenge
We were asked to do a feasibility study of a piece of software called MAPPS, whose goal is to simulate and calculate a spacecraft’s trajectory. The request was whether it could be ported to the GPU, and what performance improvements could be achieved. The software was specifically used for the ExoMars project, and the focus was therefore on Mars. However, it could be used for any planet in theory. For this software, the following are computed at each point along the trajectory: the position of the planet, the position of the spacecraft, the altitude of the spacecraft, the distance between the spacecraft and the planet, and the angle between the spacecraft and the Sun. The calculations were based on a large set of algorithms including Chebyshev, Hermite and Lagrange.
These calculations took 80 seconds for a single trajectory with a duration of 12 months. This limited the types of full experiments, where many trajectories need to be calculated.
The primary objective was to make it multi-threaded. The secondary objective was to test the possibility to migrate to a GPU system.
A preference that was added later was that it would work well on their work laptops. This meant that the software needed to be working correctly on multiple hardware platforms as the full set of target architectures would not be known. Also, it needed to be much faster than the original CPU-only code, such that an HPC cluster or bigger computer was not needed.
The approach
The original code used single-threaded code, which also meant it used single-threaded algorithms. Therefore, we needed a completely new approach for most of the software in the limited time we had for this project. We chose to fully focus on the algorithmic optimizations, as that would have the greatest impact. The Lagrange computations took almost 84% of the time, and consequently received the most attention. We spent less time on low-level optimizations, as it needed to run on various hardware platforms.
When we set out to execute the project, it would have been satisfactory to only do a theoretical study for the GPU. We found that the specific set of algorithms were quite portable to both multicore CPUs and GPUs. By using OpenCL, we could target both CPUs and GPUs, and free two birds with one key.
We chose to use Boost.Compute. This is an OpenCL library that has many small algorithms already implemented. One of our colleagues was a co-developer of the library, which meant we knew very well how to use it. Altogether, we could hit the ground running.
We chose a list of easily available CPUs and GPUs, e.g. Intel i7-8550U, Intel i7-4820K, NVIDIA Titan V, Nvidia GTX 980, AMD MI25, and AMD FirePro S9300. This allowed us to cover multiple architectures, including the ones we knew were used in the work laptops.
The result
The original code took 80 seconds for a small simulation (calculating positions for Mars and the satellite for a 12-month period). Our accelerated code took 989 ms on an i7-4820K CPU. On an AMD MI25 it took 138 ms, and on an Nvidia Titan V it took 65 ms.
The Lagrange computations that took 84% of the time were sped up 262.4× on the same CPU.
For the full simulation, there was an 81× speedup on the CPU, and another 15× speedup on a high-end GPU. The total speedup was 1231×.
Key takeaway
The scientists at ESA can now run MAPPS on their own laptop in a single second. A larger simulation that used to take an hour now takes seconds on that same laptop.
The code is easy to port to CUDA, HIP or SYCL, if needed.
Did you enjoy reading about how we ported ESA’s MAPPS project to multicore CPU and GPU with OpenCL? You can read about more projects we worked on by checking out our other case studies.