This provides some parameters that control the behavior of various functions in the TBCI library.
More...
This provides some parameters that control the behavior of various functions in the TBCI library.
The behavior of the TBCI lib is controlled by the following settings:
- Whether the library should check for errors when performing operations – the checks enabled with this do NOT impose a significant performance overhead, so it's recommended to enable this (which is default). This setting is not available if the library is compiled with TBCI_NO_ERRCHECK.
- Whether the library does expensive error checks. This does enable bound checking for vector and matrix element access, which makes it expensive ... You can only enable this if you compile with -DTBCI_EXPCHECK. If you do, then it's also enabled by default.
- Whether the library should abort execution when detecting errors. This is useful in a debugger, where you can use the backtrace to locate the issue. This is disabled by default.
- Whether the library should throw exceptions on detected errors. All exceptions should be decendants of TBCI::NumErr. This is enabled by default; if you disable it, an error message will be printed to stderr and the program will continue (with the most likely wrong values resulting from the error condition).
- Whether the library should use an algorithm to produce exact sums when doing vector sums, vector dot products or vector absolute computation. (We don't use Kahan's algorithm, but a slightly better and more efficient one.) This approximately doubles the effort for calculating the sum – on multithreaded operations, this may however become insignificant due to being limited by memory bandwidth and not FPU power. This is disabled by default.
- Whether the library should use the exact summation algorithm also for Matrix Vector and Matrix Matrix products. (Note – not all matrix types have fully implemented this; for some cases it's very non-trivial ...) This is disabled by default.
The TBCI configuration is stored in the control word TBCI::tbci_control; this variable is contained (weakly) in the smp.cc file (because that's the only place in TBCI where we have global static variables). If you don't link with the smp object (by -ltbcismp), you need to put
in your main program. (However, as SMP support is enabled by default nowadays, chances are that you'll have to link against -ltbcismp anyway.)
Definition in file tbci_param.h.