Hostname: page-component-586b7cd67f-rdxmf Total loading time: 0 Render date: 2024-11-24T21:00:41.241Z Has data issue: false hasContentIssue false

A general framework for static profiling of parametric resource usage*

Published online by Cambridge University Press:  14 October 2016

P. LOPEZ-GARCIA
Affiliation:
IMDEA Software Institute (e-mail: [email protected], [email protected], [email protected], [email protected]) Spanish Council for Scientific Research (CSIC)
M. KLEMEN
Affiliation:
U. LIQAT
Affiliation:
M. V. HERMENEGILDO
Affiliation:
IMDEA Software Institute (e-mail: [email protected], [email protected], [email protected], [email protected]) Technical University of Madrid (UPM)

Abstract

For some applications, standard resource analyses do not provide the information required. Such analyses estimate the total resource usage of a program (without executing it) as functions on input data sizes. However, some applications require knowing how such total resource usage is distributed over selected parts of a program. We propose a novel, general, and flexible framework for setting up cost equations/relations which can be instantiated for performing a wide range of resource usage analyses, including both static profiling and the inference of the standard notion of cost. We extend and generalize standard resource analysis techniques, so that the relations generated include additional Boolean control variables for switching on or off different terms in the relations, as required by the desired resource usage profile. We also instantiate our framework to perform static profiling of accumulated cost (also parameterized by input data sizes). Such information is much more useful to the software developer than the standard notion of cost: it identifies the parts of the program that have the greatest impact on the total program cost, and which therefore should be optimized first. We also report on an implementation of our framework within the CiaoPP system, and its instantiation for accumulated cost, and provide some experimental results. In addition to generality, our new method brings important advantages over our previous approach based on a program transformation, including support for non-deterministic programs, better and easier integration in the compiler, and higher efficiency.

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2016 

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Footnotes

*

This research has received funding from EU FP7 agreement no 318337 ENTRA, Spanish MINECO TIN2012-39391 StrongSoft and TIN2015-67522-C3-1-R TRACES projects, and the Madrid M141047003 N-GREENS program. Special thanks are due to John Gallagher for many fruitful and inspiring discussions and to the anonymous reviewers for their detailed and useful comments.

References

Albert, E., Arenas, P., Genaim, S. and Puebla, G. 2011. Closed-form upper bounds in static cost analysis. Journal of Automated Reasoning 46, 2, 161203.CrossRefGoogle Scholar
Albert, E., Genaim, S. and Masud, A. N. 2011. More precise yet widely applicable cost analysis. In Proc. of VMCAI'11, LNCS, vol. 6538. Springer, 3853.Google Scholar
Debray, S. K. and Lin, N. W. 1993. Cost analysis of logic programs. ACM TOPLAS 15, 5 (November), 826875.CrossRefGoogle Scholar
Debray, S. K., Lin, N.-W. and Hermenegildo, M. 1990. Task granularity analysis in logic programs. In Proc. PLDI'90. ACM, 174188.CrossRefGoogle Scholar
Debray, S. K., López-García, P., Hermenegildo, M. and Lin, N.-W. 1997. Lower bound cost estimation for logic programs. In ILPS'97. MIT Press, 291305.Google Scholar
Giesl, J., Ströder, T., Schneider-Kamp, P., Emmes, F. and Fuhs, C. 2012. Symbolic evaluation graphs and term rewriting: a general methodology for analyzing logic programs. In Proceedings of PPDP'12. ACM, 112.Google Scholar
Grobauer, B. 2001. Cost recurrences for DML programs. In Proceedings of ICFP '01. ACM, New York, NY, USA, 253264.CrossRefGoogle Scholar
Gulwani, S., Mehra, K. K. and Chilimbi, T. M. 2009. SPEED: Precise and efficient static estimation of program computational complexity. In The 36th Symposium on Principles of Programming Languages (POPL'09). ACM, 127139.Google Scholar
Haemmerlé, R., Lopez-Garcia, P., Liqat, U., Klemen, M., Gallagher, J. P. and Hermenegildo, M. V. 2016. A transformational approach to parametric accumulated-cost static profiling. In FLOPS'16, LNCS, vol. 9613. Springer, 163180.Google Scholar
Hermenegildo, M., Puebla, G., Bueno, F. and García, P. L. 2005. Integrated program debugging, verification, and optimization using abstract interpretation (and The Ciao System Preprocessor). Science of Computer Programming 58, 1–2, 115140.CrossRefGoogle Scholar
Hermenegildo, M. V., Bueno, F., Carro, M., López, P., Mera, E., Morales, J. and Puebla, G. 2012. An overview of ciao and its design philosophy. Theory and Practice of Logic Programming 12, 1–2, 219252. http://arxiv.org/abs/1102.5497.CrossRefGoogle Scholar
Hoffmann, J., Aehlig, K. and Hofmann, M. 2012. Multivariate amortized resource analysis. ACM TOPLAS 34, 3, 14:114:62.CrossRefGoogle Scholar
Igarashi, A. and Kobayashi, N. 2002. Resource usage analysis. In Symposium on Principles of Programming Languages. ACM, 331342.Google Scholar
Liqat, U., Georgiou, K., Kerrison, S., Lopez-Garcia, P., Hermenegildo, M. V., Gallagher, J. P. and Eder, K. 2016. Inferring Parametric Energy Consumption Functions at Different Software Levels: ISA vs. LLVM IR. In Proc. of FOPARA, LNCS. Springer. In press.Google Scholar
Liqat, U., Kerrison, S., Serrano, A., Georgiou, K., Lopez-Garcia, P., Grech, N., Hermenegildo, M. and Eder, K. 2014. Energy consumption analysis of programs based on XMOS ISA-level models. In Proceedings of LOPSTR'13, LNCS, vol. 8901. Springer, 7290.Google Scholar
Méndez-Lojo, M., Navas, J. and Hermenegildo, M. 2007. A Flexible (C)LP-Based Approach to the Analysis of Object-Oriented Programs. In LOPSTR 2007. Number 4915 in LNCS. Springer-Verlag, 154168.Google Scholar
Mera, E., Trigo, T., López-García, P. and Hermenegildo, M. 2011. Profiling for run-time checking of computational properties and performance debugging. In PADL. LNCS, vol. 6539. 38–53.Google Scholar
Morgan, R. G. and Jarvis, S. A. 1998. Profiling Large-Scale Lazy Functional Programs. Journal of Functional Programing 8, 3, 201237.CrossRefGoogle Scholar
Muthukumar, K. and Hermenegildo, M. 1992. Compile-time derivation of variable dependency using abstract interpretation. JLP 13, 2/3 (July), 315347.CrossRefGoogle Scholar
Navas, J., Méndez-Lojo, M. and Hermenegildo, M. 2008. Safe upper-bounds inference of energy consumption for Java Bytecode Applications. In NASA LFM'08. 29–32.Google Scholar
Navas, J., Mera, E., López-García, P. and Hermenegildo, M. 2007. User-definable resource bounds analysis for logic programs. In Proc. of ICLP'07. LNCS, vol. 4670. Springer, 348363.Google Scholar
Nielson, F., Nielson, H. and Seidl, H. 2002. Automatic complexity analysis. In Programming Languages and Systems, LNCS. Springer, 243261.CrossRefGoogle Scholar
Puebla, G. and Hermenegildo, M. 1996. Optimized algorithms for the incremental analysis of logic programs. In SAS'96. Springer LNCS 1145, 270284.Google Scholar
Rosendahl, M. 1989. Automatic complexity analysis. In Proc. of FPCA'89. ACM Press, 144156.CrossRefGoogle Scholar
Sansom, P. M. and Jones, S. L. P. 1995. Time and space profiling for non-strict, higher-order functional languages. In Proc. of POPL'95. ACM, New York, NY, USA, 355366.CrossRefGoogle Scholar
Serrano, A., Lopez-Garcia, P. and Hermenegildo, M. 2014. Resource usage analysis of logic programs via abstract interpretation using sized types. Theory and Practice of Logic Programming, ICLP'14 Special Issue 14, 4–5, 739754.CrossRefGoogle Scholar
Vasconcelos, P. and Hammond, K. 2003. Inferring cost equations for recursive, polymorphic and higher-order functional programs. In IFL'03, LNCS, vol. 3145. Springer, 86101.Google Scholar
Wegbreit, B. 1975. Mechanical program analysis. Comm. of the ACM 18, 9, 528539.CrossRefGoogle Scholar
Supplementary material: PDF

Lopez-Garcia supplementary material

Online Appendix

Download Lopez-Garcia supplementary material(PDF)
PDF 279.8 KB