cannam@95
|
1 <html lang="en">
|
cannam@95
|
2 <head>
|
cannam@95
|
3 <title>Words of Wisdom-Saving Plans - FFTW 3.3.3</title>
|
cannam@95
|
4 <meta http-equiv="Content-Type" content="text/html">
|
cannam@95
|
5 <meta name="description" content="FFTW 3.3.3">
|
cannam@95
|
6 <meta name="generator" content="makeinfo 4.13">
|
cannam@95
|
7 <link title="Top" rel="start" href="index.html#Top">
|
cannam@95
|
8 <link rel="up" href="Other-Important-Topics.html#Other-Important-Topics" title="Other Important Topics">
|
cannam@95
|
9 <link rel="prev" href="Multi_002ddimensional-Array-Format.html#Multi_002ddimensional-Array-Format" title="Multi-dimensional Array Format">
|
cannam@95
|
10 <link rel="next" href="Caveats-in-Using-Wisdom.html#Caveats-in-Using-Wisdom" title="Caveats in Using Wisdom">
|
cannam@95
|
11 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
cannam@95
|
12 <!--
|
cannam@95
|
13 This manual is for FFTW
|
cannam@95
|
14 (version 3.3.3, 25 November 2012).
|
cannam@95
|
15
|
cannam@95
|
16 Copyright (C) 2003 Matteo Frigo.
|
cannam@95
|
17
|
cannam@95
|
18 Copyright (C) 2003 Massachusetts Institute of Technology.
|
cannam@95
|
19
|
cannam@95
|
20 Permission is granted to make and distribute verbatim copies of
|
cannam@95
|
21 this manual provided the copyright notice and this permission
|
cannam@95
|
22 notice are preserved on all copies.
|
cannam@95
|
23
|
cannam@95
|
24 Permission is granted to copy and distribute modified versions of
|
cannam@95
|
25 this manual under the conditions for verbatim copying, provided
|
cannam@95
|
26 that the entire resulting derived work is distributed under the
|
cannam@95
|
27 terms of a permission notice identical to this one.
|
cannam@95
|
28
|
cannam@95
|
29 Permission is granted to copy and distribute translations of this
|
cannam@95
|
30 manual into another language, under the above conditions for
|
cannam@95
|
31 modified versions, except that this permission notice may be
|
cannam@95
|
32 stated in a translation approved by the Free Software Foundation.
|
cannam@95
|
33 -->
|
cannam@95
|
34 <meta http-equiv="Content-Style-Type" content="text/css">
|
cannam@95
|
35 <style type="text/css"><!--
|
cannam@95
|
36 pre.display { font-family:inherit }
|
cannam@95
|
37 pre.format { font-family:inherit }
|
cannam@95
|
38 pre.smalldisplay { font-family:inherit; font-size:smaller }
|
cannam@95
|
39 pre.smallformat { font-family:inherit; font-size:smaller }
|
cannam@95
|
40 pre.smallexample { font-size:smaller }
|
cannam@95
|
41 pre.smalllisp { font-size:smaller }
|
cannam@95
|
42 span.sc { font-variant:small-caps }
|
cannam@95
|
43 span.roman { font-family:serif; font-weight:normal; }
|
cannam@95
|
44 span.sansserif { font-family:sans-serif; font-weight:normal; }
|
cannam@95
|
45 --></style>
|
cannam@95
|
46 </head>
|
cannam@95
|
47 <body>
|
cannam@95
|
48 <div class="node">
|
cannam@95
|
49 <a name="Words-of-Wisdom-Saving-Plans"></a>
|
cannam@95
|
50 <a name="Words-of-Wisdom_002dSaving-Plans"></a>
|
cannam@95
|
51 <p>
|
cannam@95
|
52 Next: <a rel="next" accesskey="n" href="Caveats-in-Using-Wisdom.html#Caveats-in-Using-Wisdom">Caveats in Using Wisdom</a>,
|
cannam@95
|
53 Previous: <a rel="previous" accesskey="p" href="Multi_002ddimensional-Array-Format.html#Multi_002ddimensional-Array-Format">Multi-dimensional Array Format</a>,
|
cannam@95
|
54 Up: <a rel="up" accesskey="u" href="Other-Important-Topics.html#Other-Important-Topics">Other Important Topics</a>
|
cannam@95
|
55 <hr>
|
cannam@95
|
56 </div>
|
cannam@95
|
57
|
cannam@95
|
58 <h3 class="section">3.3 Words of Wisdom—Saving Plans</h3>
|
cannam@95
|
59
|
cannam@95
|
60 <p><a name="index-wisdom-124"></a><a name="index-saving-plans-to-disk-125"></a>
|
cannam@95
|
61 FFTW implements a method for saving plans to disk and restoring them.
|
cannam@95
|
62 In fact, what FFTW does is more general than just saving and loading
|
cannam@95
|
63 plans. The mechanism is called <dfn>wisdom</dfn>. Here, we describe
|
cannam@95
|
64 this feature at a high level. See <a href="FFTW-Reference.html#FFTW-Reference">FFTW Reference</a>, for a less casual
|
cannam@95
|
65 but more complete discussion of how to use wisdom in FFTW.
|
cannam@95
|
66
|
cannam@95
|
67 <p>Plans created with the <code>FFTW_MEASURE</code>, <code>FFTW_PATIENT</code>, or
|
cannam@95
|
68 <code>FFTW_EXHAUSTIVE</code> options produce near-optimal FFT performance,
|
cannam@95
|
69 but may require a long time to compute because FFTW must measure the
|
cannam@95
|
70 runtime of many possible plans and select the best one. This setup is
|
cannam@95
|
71 designed for the situations where so many transforms of the same size
|
cannam@95
|
72 must be computed that the start-up time is irrelevant. For short
|
cannam@95
|
73 initialization times, but slower transforms, we have provided
|
cannam@95
|
74 <code>FFTW_ESTIMATE</code>. The <code>wisdom</code> mechanism is a way to get the
|
cannam@95
|
75 best of both worlds: you compute a good plan once, save it to
|
cannam@95
|
76 disk, and later reload it as many times as necessary. The wisdom
|
cannam@95
|
77 mechanism can actually save and reload many plans at once, not just
|
cannam@95
|
78 one.
|
cannam@95
|
79 <a name="index-FFTW_005fMEASURE-126"></a><a name="index-FFTW_005fPATIENT-127"></a><a name="index-FFTW_005fEXHAUSTIVE-128"></a><a name="index-FFTW_005fESTIMATE-129"></a>
|
cannam@95
|
80
|
cannam@95
|
81 <p>Whenever you create a plan, the FFTW planner accumulates wisdom, which
|
cannam@95
|
82 is information sufficient to reconstruct the plan. After planning,
|
cannam@95
|
83 you can save this information to disk by means of the function:
|
cannam@95
|
84 <pre class="example"> int fftw_export_wisdom_to_filename(const char *filename);
|
cannam@95
|
85 </pre>
|
cannam@95
|
86 <p><a name="index-fftw_005fexport_005fwisdom_005fto_005ffilename-130"></a>(This function returns non-zero on success.)
|
cannam@95
|
87
|
cannam@95
|
88 <p>The next time you run the program, you can restore the wisdom with
|
cannam@95
|
89 <code>fftw_import_wisdom_from_filename</code> (which also returns non-zero on success),
|
cannam@95
|
90 and then recreate the plan using the same flags as before.
|
cannam@95
|
91 <pre class="example"> int fftw_import_wisdom_from_filename(const char *filename);
|
cannam@95
|
92 </pre>
|
cannam@95
|
93 <p><a name="index-fftw_005fimport_005fwisdom_005ffrom_005ffilename-131"></a>
|
cannam@95
|
94 Wisdom is automatically used for any size to which it is applicable, as
|
cannam@95
|
95 long as the planner flags are not more “patient” than those with which
|
cannam@95
|
96 the wisdom was created. For example, wisdom created with
|
cannam@95
|
97 <code>FFTW_MEASURE</code> can be used if you later plan with
|
cannam@95
|
98 <code>FFTW_ESTIMATE</code> or <code>FFTW_MEASURE</code>, but not with
|
cannam@95
|
99 <code>FFTW_PATIENT</code>.
|
cannam@95
|
100
|
cannam@95
|
101 <p>The <code>wisdom</code> is cumulative, and is stored in a global, private
|
cannam@95
|
102 data structure managed internally by FFTW. The storage space required
|
cannam@95
|
103 is minimal, proportional to the logarithm of the sizes the wisdom was
|
cannam@95
|
104 generated from. If memory usage is a concern, however, the wisdom can
|
cannam@95
|
105 be forgotten and its associated memory freed by calling:
|
cannam@95
|
106 <pre class="example"> void fftw_forget_wisdom(void);
|
cannam@95
|
107 </pre>
|
cannam@95
|
108 <p><a name="index-fftw_005fforget_005fwisdom-132"></a>
|
cannam@95
|
109 Wisdom can be exported to a file, a string, or any other medium.
|
cannam@95
|
110 For details, see <a href="Wisdom.html#Wisdom">Wisdom</a>.
|
cannam@95
|
111
|
cannam@95
|
112 </body></html>
|
cannam@95
|
113
|