How to produce more efficient, less energy-consuming code?
-
As applications become more compute-intensive, the challenge of producing more efficient, less energy-consuming code was the starting point for our collaboration with CNES.
Learn how this collaboration resulted in significant gains for two satellite image processing software applications running on CNES servers.
Starting point of this collaboration
The Centre National d’Études Spatiales (CNES) is developing several image processing algorithms to analyze satellite images, as part of its research into environmental and climate change.
This objective has led the CNES to explore new technologies and opportunities. But with a strong commitment to environmental responsibility and ambitious environmental objectives, it goes without saying that the CNES is keen to ensure that the algorithms it develops have a controlled impact on the environment.
As part of the establishment’s CSR policy, the teams we worked with are committed to reducing the environmental footprint of the software they develop and use.
In this context, the work we carried out focused on investigating the potential gains in server power consumption for two satellite image processing software applications running on CNES servers.
How to solve this problem?
What makes our expertise unique is the way we explore a source code to understand its organization and data structure in relation to the hardware target on which it will be executed.
This combination allows us to determine whether the target is being used to its full potential with respect to its goals and, in conjunction with a full range of optimization techniques, to determine what can be optimized.
This diagnostic phase allows us to quantify potential gains, select where to focus optimization efforts, and then initiate optimization. Of course, we also consider the characteristics of the compiler being used, so we can only suggest optimization techniques that are not already implemented by the customer’s compiler.
Diagnostic implementation and results
We worked on software applications running on the CNES HAL and TREX computing clusters with x86-64 processors (AVX512 instruction set with 512-bit SIMD).
3 main analyses were performed on the two-satellite image processing software packages:
- Performance analysis
- Data integrity verification
- Efficiency analysis
➡️ Learn out more about the performed analyses
Several optimization paths were identified, 9 in total. By focusing on the core C++ computations, the optimization techniques implemented on the two software packages delivered significant unit gains in execution time.
Towards Implementation of Optimization Techniques
At the end of the optimization phase, average gains of 46% and 50% in C++ code execution time were achieved for both applications.
Several optimization techniques were employed:
- Function inlining
- Writing min/max operations
- Factorization
- Loop unwinding
- Single Instruction Multiple Data (SIMD)
- ….
What lessons did we learn?
This was WedoLow’s first collaboration with server-based software applications. It was a big challenge for the team because in our desire to have a real impact on energy consumption and greenhouse gas emissions related to digital technology, working on server-based software was a key element. We were able to validate our contribution and the gains on servers.
We were also able to validate that certain optimization techniques discovered on embedded software could also bring gains on hosted software.
Finally, we were able to compare the energy costs of Python with those of C++!
Download the case study available to see the gains achieved and the optimization techniques implemented.