Skip to content

Potential future performance issue with multiple Meshes and FFTW #2097

Open
@johnomotani

Description

@johnomotani

At some point we intend to support simulations with multiple Mesh objects. We might then have different grids with different nz. At the moment rfft, irfft, DST and DST_rev are functions which use static variables to initialise buffers and FFTW plans

// static variables initialized once
static double *fin;
static fftw_complex *fout;
static fftw_plan p;
static int n = 0;

If variables with different n are passed, this will be very inefficient as the FFTW plan will be re-created each time n changes, which is expensive.

At some point we should probably make these methods of some sort of class that can cache plans for different n.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions