C++ reflection for high performance problem solving environments
Tharaka Devadithya, Kenneth Chiu, Wei Lu · 2007
generic programming, scientific computing, high perfor-mance computing Problem Solving Environments (PSE) in scientific comput-ing domains require the ability to couple High Performance Computing (HPC) components. A PSE facilitates coupling of tasks or computations in order to aid a scientist in find-ing a solution to a problem or at least getting closer to a so-lution. Reflection capabilities are required in order to effec-tively dynamically couple these components. Reflection fa-cilitates adaptive behavior such as rebinding calls to differ-ent functions at run-time, or integrating flexible interpreted languages with compiled languages such as C++ or Fortran. Currently, however, reflection is not available in languages commonly used in high performance computing. While there have been several attempts to incorporate reflection into C++, all of them are either intrusive or are not fully compliant with the C++ standard. In this paper, we present a number of use cases for reflective programming, and show how it can be effi-ciently and robustly implemented in languages such as C++. Our implementation uses code generation to add metadata, and is fully compliant with the standard C++ specification. We compare the overhead of reflection with languages such as Java, and show that our overhead is acceptable for many scenarios. Our reflection library is open-source, and is avail-able at