Skip to content

Make faster mapping used for gyrokinetic sims public #2017

@unalmis

Description

@unalmis

According to Yigit, some groups have been using a private method I wrote in #1826 for gyrokinetic simulations. They are probably using it because it is 250x faster than the existing public method offered by DESC. This method is currently still a private method because the API is expected to change once the next improvement is released, which will likely yield another performance boost by at least $10^3$. It would also reduce memory. Therefore, this issue documents the need for someone to complete that task and make the method public.

partial sum zernike.pdf

Note that, the starting point for the spectral to real space transform is the two-dimensional set of fourier modes on each surface since you have already summed over radial modes to compute lambda on surface in other routines. So all you need to do is matrix multiply the toroidal modes with the precomputed vandermonde basis at the given zeta points. This yields the Fourier series in theta on every (rho, zeta) with cheap cost of the following number of fused multiply and adds

$$n_{\rho} \times n_{\theta, modes} \times n_{\zeta, modes} \times n_{\zeta}$$

and in particular only requires storing a precomputed Vandermonde matrix of size

$$n_{\zeta, modes} \times n_{\zeta}$$

This is far more performance than the full spectral to real space transform that is currently done which multiples all points by all modes then takes FFTs which has slow performance of $N^6 + n_{\rho} \times n_{\zeta} \times n_{\theta} \log n_{\theta} \gg N^4$.
Therefore, this would be factor of $10^3$ speed up to move this routine to microsecond range and reduce memory storage for precomputed matrix and gradients that accumulate for AD.

The objectives that would benefit most from this are the ballooning stability objectives and the bounce integral objectives. The ballooning stability objectives still use the slow method which takes seconds which is significant, so implementing this would see a 10^6 performance boost in that subroutine and that would be measurable.

Metadata

Metadata

Assignees

Labels

P1Lowest Priority, will get to eventuallyperformanceNew feature or request to make the code faster

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions