cannam@95: cannam@95: cannam@95: Caveats in Using Wisdom - FFTW 3.3.3 cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95: cannam@95:
cannam@95: cannam@95:

cannam@95: Previous: Words of Wisdom-Saving Plans, cannam@95: Up: Other Important Topics cannam@95:


cannam@95:
cannam@95: cannam@95:

3.4 Caveats in Using Wisdom

cannam@95: cannam@95:

cannam@95:

cannam@95: For in much wisdom is much grief, and he that increaseth knowledge cannam@95: increaseth sorrow. cannam@95: [Ecclesiastes 1:18] cannam@95:
cannam@95: cannam@95:

There are pitfalls to using wisdom, in that it can negate FFTW's cannam@95: ability to adapt to changing hardware and other conditions. For cannam@95: example, it would be perfectly possible to export wisdom from a cannam@95: program running on one processor and import it into a program running cannam@95: on another processor. Doing so, however, would mean that the second cannam@95: program would use plans optimized for the first processor, instead of cannam@95: the one it is running on. cannam@95: cannam@95:

It should be safe to reuse wisdom as long as the hardware and program cannam@95: binaries remain unchanged. (Actually, the optimal plan may change even cannam@95: between runs of the same binary on identical hardware, due to cannam@95: differences in the virtual memory environment, etcetera. Users cannam@95: seriously interested in performance should worry about this problem, cannam@95: too.) It is likely that, if the same wisdom is used for two cannam@95: different program binaries, even running on the same machine, the cannam@95: plans may be sub-optimal because of differing code alignments. It is cannam@95: therefore wise to recreate wisdom every time an application is cannam@95: recompiled. The more the underlying hardware and software changes cannam@95: between the creation of wisdom and its use, the greater grows cannam@95: the risk of sub-optimal plans. cannam@95: cannam@95:

Nevertheless, if the choice is between using FFTW_ESTIMATE or cannam@95: using possibly-suboptimal wisdom (created on the same machine, but for a cannam@95: different binary), the wisdom is likely to be better. For this reason, cannam@95: we provide a function to import wisdom from a standard system-wide cannam@95: location (/etc/fftw/wisdom on Unix): cannam@95: cannam@95:

     int fftw_import_system_wisdom(void);
cannam@95: 
cannam@95:

cannam@95: FFTW also provides a standalone program, fftw-wisdom (described cannam@95: by its own man page on Unix) with which users can create wisdom, cannam@95: e.g. for a canonical set of sizes to store in the system wisdom file. cannam@95: See Wisdom Utilities. cannam@95: cannam@95: cannam@95: cannam@95: