Advanced expression templates programming (original) (raw)

Abstract

Expression Templates (ET) are a powerful tool for development of user-friendly numerical libraries. By this concept and by operator overloading in C++, numerical algorithms can be implemented in a mathematical notation without decreasing the performance in comparison to optimized C or FORTRAN codes. In this paper, we present new Expression Template techniques. First, we explain the concept of “Easy Expression Templates”, which are easier to implement than classical ET. Then, we explain “Fast Expression Templates”. This concept leads to an optimal performance even on special architectures like vector machines. Furthermore, concepts for storing expressions and code optimizing are presented. In order to verify the usability of these programming techniques in real applications, we discuss a template library which calculates local stiffness matrices arising from Finite Element discretizations.

Similar content being viewed by others

References

  1. Basetti, F., Davis, K., Quinlan, D.: C++ Expression Templates Performance Issues in Scientific Computing. CRPC-TR97705-S (1997)
  2. Ciarlet, P.G.: The Finite Element Method for Elliptic Problems. SIAM (2002)
  3. Haney S.: Beating the abstraction penalty in C++ using expression templates. In: Dubois, P. (eds) Computers in Physics, vol 10, No. 6, pp. 552–557. American Institute Of Physics, USA (1996)
    Google Scholar
  4. Haney, S., Crotinger, J., Karmesin, S., Smith, S.: PETE: the portable expression templates engine. Dr. Dobb’s J. Softw. Tools, 24(10):88, pp. 90–92, 94–95 (1998)
  5. Härdtlein, J., Linke, A., Pflaum, C.: Fast expression templates. In: Suneram, V.S., Albada, G.D.V., Sloot, P.M.A., Dongarra, J.J. (eds.), Computational Science—ICCS 2005, volume 3515 of LNCS. Springer, ISBN-10 3-540-26043-9, ISBN-13 978-3-540-26043-1, ISSN 03-2-9743. pp. 1055–1063 (2005)
  6. Härdtlein, J., Pflaum, C.: Efficient and user-friendly computation of local stiffness matrices. In: Hülsemann, F., Kowarschik, M., Rüde, U. (eds.), 18th Symposium Simulationstechnique ASIM 2005 Proceedings, volume 15 of Frontiers in Simulation. ASIM, SCS Publishing House, ISBN 3-936150-41. pp. 748–753 (2005)
  7. Kirby, R.C., Logg, A.: Efficient compilation of a class of variational forms. ACM Trans. Math. Softw. 33(3), Article 17 (2007)
    Google Scholar
  8. Los Alamos National Laboratories. POOMA. http://www.acl.lanl.gov/pooma
  9. Linke, A., Pflaum, C.: Fast expression templates for the SR 8000 supercomputer. In: Stiegritz, J., Davis K. (eds.) Proceedings of the Workshop on Parallel/High-Performance Object-Oriented Scientific Computing (POOSC). Technical Report, FZJ-ZAM-IB-2003-09, (2003)
  10. Pflaum C.: Expression templates for partial differential equations. Comput. Visual. Sci. 4, 1–8 (2001)
    Article MATH Google Scholar
  11. High Performance Center Stuttgart: The NEC SX-6 Cluster Documentation. http://www.hlrs.de/hw-access/platforms/sx6/user_doc (2005)
  12. Veldhuizen T.: Expression templates. C++ Report 7(5), 26–31 (1995)
    Google Scholar
  13. Veldhuizen, T.: Techniques for Scientific C++. Indiana University Computer Science Technical Report No 542, Version 0.4 (2000)
  14. Veldhuizen, T.: Blitz++ User’s Guide—Version 1.2. http://oonumerics.org/blitz/manual/blitz.html. (2001)
  15. Vandevoorde D., Josuttis N.: C++ Templates—The Complete Guide. Addison-Wesley, Reading (2003)
    Google Scholar
  16. Walter, J., Koch, M.: uBLAS, Boost C++ Libraries - Basic Linear Algebra. http://www.boost.org/libs/numeric/ublas/doc/index.htm. (2002)
  17. Wolters C.H., Köstler H., Möller C., Härdtlein J., Grasedyck L., Hackbusch W.: Numerical mathematics of the subtraction method for the modeling of a current dipole in EEG source reconstruction using finite element head models. SIAM J. Sci. Comput 30(1), 24–45 (2007)
    Article MATH MathSciNet Google Scholar

Download references

Author information

Authors and Affiliations

  1. Department of Computer Science 10, University of Erlangen-Nuremberg, Cauerstr. 6, 91058, Erlangen, Germany
    J. Härdtlein & C. Pflaum
  2. Weierstrass Institute for Applied Analysis and Stochastics, Mohrenstr. 39, 10117, Berlin, Germany
    A. Linke
  3. Institute for Biomagnetism and Biosignalanalysis, University of Muenster, 48149, Muenster, Germany
    C. H. Wolters

Authors

  1. J. Härdtlein
  2. C. Pflaum
  3. A. Linke
  4. C. H. Wolters

Corresponding author

Correspondence toC. Pflaum.

Additional information

Communicated by G. Wittum.

Rights and permissions

About this article

Cite this article

Härdtlein, J., Pflaum, C., Linke, A. et al. Advanced expression templates programming.Comput. Visual Sci. 13, 59 (2010). https://doi.org/10.1007/s00791-009-0128-2

Download citation

Keywords