Chris@82: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Chris@82: <html>
Chris@82: <!-- This manual is for FFTW
Chris@82: (version 3.3.8, 24 May 2018).
Chris@82: 
Chris@82: Copyright (C) 2003 Matteo Frigo.
Chris@82: 
Chris@82: Copyright (C) 2003 Massachusetts Institute of Technology.
Chris@82: 
Chris@82: Permission is granted to make and distribute verbatim copies of this
Chris@82: manual provided the copyright notice and this permission notice are
Chris@82: preserved on all copies.
Chris@82: 
Chris@82: Permission is granted to copy and distribute modified versions of this
Chris@82: manual under the conditions for verbatim copying, provided that the
Chris@82: entire resulting derived work is distributed under the terms of a
Chris@82: permission notice identical to this one.
Chris@82: 
Chris@82: Permission is granted to copy and distribute translations of this manual
Chris@82: into another language, under the above conditions for modified versions,
Chris@82: except that this permission notice may be stated in a translation
Chris@82: approved by the Free Software Foundation. -->
Chris@82: <!-- Created by GNU Texinfo 6.3, http://www.gnu.org/software/texinfo/ -->
Chris@82: <head>
Chris@82: <title>FFTW 3.3.8: Caveats in Using Wisdom</title>
Chris@82: 
Chris@82: <meta name="description" content="FFTW 3.3.8: Caveats in Using Wisdom">
Chris@82: <meta name="keywords" content="FFTW 3.3.8: Caveats in Using Wisdom">
Chris@82: <meta name="resource-type" content="document">
Chris@82: <meta name="distribution" content="global">
Chris@82: <meta name="Generator" content="makeinfo">
Chris@82: <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Chris@82: <link href="index.html#Top" rel="start" title="Top">
Chris@82: <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
Chris@82: <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
Chris@82: <link href="Other-Important-Topics.html#Other-Important-Topics" rel="up" title="Other Important Topics">
Chris@82: <link href="FFTW-Reference.html#FFTW-Reference" rel="next" title="FFTW Reference">
Chris@82: <link href="Words-of-Wisdom_002dSaving-Plans.html#Words-of-Wisdom_002dSaving-Plans" rel="prev" title="Words of Wisdom-Saving Plans">
Chris@82: <style type="text/css">
Chris@82: <!--
Chris@82: a.summary-letter {text-decoration: none}
Chris@82: blockquote.indentedblock {margin-right: 0em}
Chris@82: blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
Chris@82: blockquote.smallquotation {font-size: smaller}
Chris@82: div.display {margin-left: 3.2em}
Chris@82: div.example {margin-left: 3.2em}
Chris@82: div.lisp {margin-left: 3.2em}
Chris@82: div.smalldisplay {margin-left: 3.2em}
Chris@82: div.smallexample {margin-left: 3.2em}
Chris@82: div.smalllisp {margin-left: 3.2em}
Chris@82: kbd {font-style: oblique}
Chris@82: pre.display {font-family: inherit}
Chris@82: pre.format {font-family: inherit}
Chris@82: pre.menu-comment {font-family: serif}
Chris@82: pre.menu-preformatted {font-family: serif}
Chris@82: pre.smalldisplay {font-family: inherit; font-size: smaller}
Chris@82: pre.smallexample {font-size: smaller}
Chris@82: pre.smallformat {font-family: inherit; font-size: smaller}
Chris@82: pre.smalllisp {font-size: smaller}
Chris@82: span.nolinebreak {white-space: nowrap}
Chris@82: span.roman {font-family: initial; font-weight: normal}
Chris@82: span.sansserif {font-family: sans-serif; font-weight: normal}
Chris@82: ul.no-bullet {list-style: none}
Chris@82: -->
Chris@82: </style>
Chris@82: 
Chris@82: 
Chris@82: </head>
Chris@82: 
Chris@82: <body lang="en">
Chris@82: <a name="Caveats-in-Using-Wisdom"></a>
Chris@82: <div class="header">
Chris@82: <p>
Chris@82: Previous: <a href="Words-of-Wisdom_002dSaving-Plans.html#Words-of-Wisdom_002dSaving-Plans" accesskey="p" rel="prev">Words of Wisdom-Saving Plans</a>, Up: <a href="Other-Important-Topics.html#Other-Important-Topics" accesskey="u" rel="up">Other Important Topics</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
Chris@82: </div>
Chris@82: <hr>
Chris@82: <a name="Caveats-in-Using-Wisdom-1"></a>
Chris@82: <h3 class="section">3.4 Caveats in Using Wisdom</h3>
Chris@82: <a name="index-wisdom_002c-problems-with"></a>
Chris@82: 
Chris@82: <blockquote>
Chris@82: <i>
Chris@82: <p>For in much wisdom is much grief, and he that increaseth knowledge
Chris@82: increaseth sorrow.
Chris@82: </i>
Chris@82: [Ecclesiastes 1:18]
Chris@82: <a name="index-Ecclesiastes"></a>
Chris@82: </p></blockquote>
Chris@82: 
Chris@82: <a name="index-portability-1"></a>
Chris@82: <p>There are pitfalls to using wisdom, in that it can negate FFTW&rsquo;s
Chris@82: ability to adapt to changing hardware and other conditions. For
Chris@82: example, it would be perfectly possible to export wisdom from a
Chris@82: program running on one processor and import it into a program running
Chris@82: on another processor.  Doing so, however, would mean that the second
Chris@82: program would use plans optimized for the first processor, instead of
Chris@82: the one it is running on.
Chris@82: </p>
Chris@82: <p>It should be safe to reuse wisdom as long as the hardware and program
Chris@82: binaries remain unchanged. (Actually, the optimal plan may change even
Chris@82: between runs of the same binary on identical hardware, due to
Chris@82: differences in the virtual memory environment, etcetera.  Users
Chris@82: seriously interested in performance should worry about this problem,
Chris@82: too.)  It is likely that, if the same wisdom is used for two
Chris@82: different program binaries, even running on the same machine, the
Chris@82: plans may be sub-optimal because of differing code alignments.  It is
Chris@82: therefore wise to recreate wisdom every time an application is
Chris@82: recompiled.  The more the underlying hardware and software changes
Chris@82: between the creation of wisdom and its use, the greater grows
Chris@82: the risk of sub-optimal plans.
Chris@82: </p>
Chris@82: <p>Nevertheless, if the choice is between using <code>FFTW_ESTIMATE</code> or
Chris@82: using possibly-suboptimal wisdom (created on the same machine, but for a
Chris@82: different binary), the wisdom is likely to be better.  For this reason,
Chris@82: we provide a function to import wisdom from a standard system-wide
Chris@82: location (<code>/etc/fftw/wisdom</code> on Unix):
Chris@82: <a name="index-wisdom_002c-system_002dwide"></a>
Chris@82: </p>
Chris@82: <div class="example">
Chris@82: <pre class="example">int fftw_import_system_wisdom(void);
Chris@82: </pre></div>
Chris@82: <a name="index-fftw_005fimport_005fsystem_005fwisdom"></a>
Chris@82: 
Chris@82: <p>FFTW also provides a standalone program, <code>fftw-wisdom</code> (described
Chris@82: by its own <code>man</code> page on Unix) with which users can create wisdom,
Chris@82: e.g. for a canonical set of sizes to store in the system wisdom file.
Chris@82: See <a href="Wisdom-Utilities.html#Wisdom-Utilities">Wisdom Utilities</a>.
Chris@82: <a name="index-fftw_002dwisdom-utility"></a>
Chris@82: </p>
Chris@82: <hr>
Chris@82: <div class="header">
Chris@82: <p>
Chris@82: Previous: <a href="Words-of-Wisdom_002dSaving-Plans.html#Words-of-Wisdom_002dSaving-Plans" accesskey="p" rel="prev">Words of Wisdom-Saving Plans</a>, Up: <a href="Other-Important-Topics.html#Other-Important-Topics" accesskey="u" rel="up">Other Important Topics</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
Chris@82: </div>
Chris@82: 
Chris@82: 
Chris@82: 
Chris@82: </body>
Chris@82: </html>