Remove deprecated inheritance of SerialDense matrices from Object
Created by: rhoope
Teuchos: Mike Eldred is using SerialDenseMatrix objects for his work in Dakota and found relatively large memory bloat associated with inherited string data from the Object base class, eg labels. He also found side benefits associated with not inherting the Object operator<< method.
This is a follow on to Issue #4183 and essentially seeks to pull the trigger on the deprecation from 2014 in the Object class, cf Teuchos_Object.hpp:
(mfh 23 Nov 2014) Pretty much just ignore the above description of this class. Very few classes in Teuchos inherit from Object. Such inheritance should be treated as deprecated legacy behavior. It's not 1990 and C++ is not Java 1.0; we don't need a common base class for everything.
@trilinos/teuchos
Labels: performance
Expectations
Current Behavior
Motivation and Context
Here is Mike's summary:
This patch removes Teuchos::Object from inheritance chains in all Teuchos::
SerialDense* classes. This has two primary effects:
> eliminates overhead from the Teuchos::Object data attributes, especially
the std::string label_.
> removes the operator<< (std::ostream& os, const Teuchos::Object& obj) that
has caused problems for us defining our own operators for Teuchos types.
*** Important note: the latter change may induce requirements on client code,
*** if they were reliant on this ostream operator. For Dakota, this is a good
*** thing as it provides the opportunity to replace an inconsistently formatted
*** operator (that has previously been in the way) with a tailored one.
Definition of Done
The advertised deprecated inheritance of SerialDense matrices is removed.
Possible Solution
Steps to Reproduce
Your Environment
- Relevant repo SHA1s:
- Relevant configure flags or configure script:
- Operating system and version:
- Compiler and TPL versions:
Related Issues
- Blocks
- Is blocked by
- Follows
- Precedes
- Related to
- Part of
- Composed of
Additional Information
I'm going to issue a pull request with at least two commits with the first containing changes needed to Teuchos proper followed by a second with the changes to client code throughout Trilinos identified using the GCC 4.8.4 PR testing setup reflected in cmake/std/PullRequestLinuxGCC4.8.4TestingSettings.cmake with Teuchos enabled and HDF5 disabled.