Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: FFTW 3.3.8: Words of Wisdom-Saving Plans Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82:
Chris@82:

Chris@82: Next: , Previous: , Up: Other Important Topics   [Contents][Index]

Chris@82:
Chris@82:
Chris@82: Chris@82:

3.3 Words of Wisdom—Saving Plans

Chris@82: Chris@82: Chris@82: Chris@82:

FFTW implements a method for saving plans to disk and restoring them. Chris@82: In fact, what FFTW does is more general than just saving and loading Chris@82: plans. The mechanism is called wisdom. Here, we describe Chris@82: this feature at a high level. See FFTW Reference, for a less casual Chris@82: but more complete discussion of how to use wisdom in FFTW. Chris@82:

Chris@82:

Plans created with the FFTW_MEASURE, FFTW_PATIENT, or Chris@82: FFTW_EXHAUSTIVE options produce near-optimal FFT performance, Chris@82: but may require a long time to compute because FFTW must measure the Chris@82: runtime of many possible plans and select the best one. This setup is Chris@82: designed for the situations where so many transforms of the same size Chris@82: must be computed that the start-up time is irrelevant. For short Chris@82: initialization times, but slower transforms, we have provided Chris@82: FFTW_ESTIMATE. The wisdom mechanism is a way to get the Chris@82: best of both worlds: you compute a good plan once, save it to Chris@82: disk, and later reload it as many times as necessary. The wisdom Chris@82: mechanism can actually save and reload many plans at once, not just Chris@82: one. Chris@82: Chris@82: Chris@82: Chris@82: Chris@82:

Chris@82: Chris@82:

Whenever you create a plan, the FFTW planner accumulates wisdom, which Chris@82: is information sufficient to reconstruct the plan. After planning, Chris@82: you can save this information to disk by means of the function: Chris@82:

Chris@82:
int fftw_export_wisdom_to_filename(const char *filename);
Chris@82: 
Chris@82: Chris@82:

(This function returns non-zero on success.) Chris@82:

Chris@82:

The next time you run the program, you can restore the wisdom with Chris@82: fftw_import_wisdom_from_filename (which also returns non-zero on success), Chris@82: and then recreate the plan using the same flags as before. Chris@82:

Chris@82:
int fftw_import_wisdom_from_filename(const char *filename);
Chris@82: 
Chris@82: Chris@82: Chris@82:

Wisdom is automatically used for any size to which it is applicable, as Chris@82: long as the planner flags are not more “patient” than those with which Chris@82: the wisdom was created. For example, wisdom created with Chris@82: FFTW_MEASURE can be used if you later plan with Chris@82: FFTW_ESTIMATE or FFTW_MEASURE, but not with Chris@82: FFTW_PATIENT. Chris@82:

Chris@82:

The wisdom is cumulative, and is stored in a global, private Chris@82: data structure managed internally by FFTW. The storage space required Chris@82: is minimal, proportional to the logarithm of the sizes the wisdom was Chris@82: generated from. If memory usage is a concern, however, the wisdom can Chris@82: be forgotten and its associated memory freed by calling: Chris@82:

Chris@82:
void fftw_forget_wisdom(void);
Chris@82: 
Chris@82: Chris@82: Chris@82:

Wisdom can be exported to a file, a string, or any other medium. Chris@82: For details, see Wisdom. Chris@82:

Chris@82:
Chris@82:
Chris@82:

Chris@82: Next: , Previous: , Up: Other Important Topics   [Contents][Index]

Chris@82:
Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: