# Minimizing Energy and Computation in Long-Running Software
## 5 Demonstration through a Real-World Example  
In Section 4, we illustrated the effect of the checkpoint interval \(n\) (i.e., the number of loop repetitions between consecutive checkpoints) on the expected execution time and energy consumption of a software program that operates in a failure-prone environment  
Figure 6: The optimum checkpoint interval \(n^{o}\) against the probability of failure \(g\) for different cases of checkpointing cost \(B^{c}\), for a program of small (a) size with \(Y=10^{4}\), and a medium sized program in (b) with \(Y=10^{5}\). Figure 7: The optimum checkpoint interval \(n^{o}\) against the probability of failure \(g\) for different cases of checkpointing cost \(B^{c}\), for a large program (a) with \(Y=10^{6}\), and a very large program (b) with \(Y=10^{7}\). through a set of numerical examples. The results of the simulation led us to the observation that the checkpoint interval should be chosen to be at (or close to) its optimum value (computed by our mathematical model) in order to achieve significant gains with respect to execution time or energy consumption and to avoid potential costs that may be caused by assigning arbitrary values to \(n\). To enhance the completeness of the present work, we also illustrate the effect of the checkpoint interval selection on the computation time and energy consumption of a real-world software program. More specifically, instead of being based on simulated values, we selected a real-world open-source software program with a configurable computational loop and we determined the required model parameters through actual measurements. Then we used our model in order to compute the optimum checkpoint intervals that optimize the execution time and energy consumption of the selected program for different cases of program size (in fact, loop length). We focused on the execution time and energy savings that could be achieved through the selection of the checkpointing interval using the proposed model. For the purposes of the present experiment, we used the Rodinia Benchmark ([[https://github.com/yuhc/gpu-rodinia](https://github.com/yuhc/gpu-rodinia)]([https://github.com/yuhc/gpu-rodinia](https://github.com/yuhc/gpu-rodinia))) [56] as the basis of our analysis. The Rodinia Benchmark is a popular benchmark of real-world open-source software programs written in C and C++ programming languages, which is widely used for benchmarking techniques and mechanisms for software performance and energy optimization. From the different programs that Rodinia contains, we used the _streamcluster_ ([[https://github.com/yuhc/gpu-rodinia/tree/master/opencl/streamcluster](https://github.com/yuhc/gpu-rodinia/tree/master/opencl/streamcluster)]([https://github.com/yuhc/gpu-rodinia/tree/master/opencl/streamcluster](https://github.com/yuhc/gpu-rodinia/tree/master/opencl/streamcluster))) program as the basis of our example. The reasoning behind the selection of this program is that it contains a computational loop that is also highly configurable, making it suitable for the purposes of our analysis. In fact, by providing the correct input, the loop can be as lengthy as we wish, allowing us to take different cases of loop length. To compute the actual parameters that are necessary for the execution of our mathematical model, the _Energy Toolbox_ of the SDK4 ED Project was utilized [57,58]. The _Energy Toolbox_ provides measurements of the execution time and energy consumption of a software program at the loop-level of granularity, being mainly based on popular profiling tools like Linux Perf ([[https://perf.wiki.kernel.org/](https://perf.wiki.kernel.org/)]([https://perf.wiki.kernel.org/](https://perf.wiki.kernel.org/))) and Valgrind ([[http://www.valgrind.org/](http://www.valgrind.org/)]([http://www.valgrind.org/](http://www.valgrind.org/))), as well as on static estimations [57,59]. The provision of loop-level performance and energy measurements made it highly suitable for our case, which actually constitutes the main reason for its selection.