Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cython updates #318

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Cython updates #318

wants to merge 6 commits into from

Conversation

karlotness
Copy link

This updates some of the flags in the Cython kernel

Cython seems to be in the process of releasing a version 3.0 which deprecates a few things. This should mostly follow their migration steps

This also removes the manual chunksize calculation since the default for the static schedule should divide the workload up evenly.

PyFFTW conditional compilation

One of the things it that seems to be under consideration for deprecation is conditional compilation (with IF) used to select pyfftw/np (cython/cython#4310).

The logic for selecting between the two is only run in the PseudoSpectralKernel.__init__ so we can instead do the selection at runtime.

The existing implementation calls pyFFTW through the Python interface and this doesn't change that.

In the case of the NumPy FFT fallback there might be some slight overhead because of calling through a bound method object, but I would expect that to be small, and users almost certainly use pyFFTW since it is installed by default.

This updates Cython to use Python3-style semantics (including for
division) and sets the NumPy API definition to silence deprecated API
warnings. Generally following suggestions from Cython's migration
guide for upcoming version 3.0.
Caused by the altered behavior with Cython language level 3.
Cython prange with a static schedule defaults to evenly dividing the
work across threads. This also removes another float-to-integer
assignment error.
The previous implementation called both PyFFTW and NumPy FFT through
their Python interfaces. This code still does that, selecting which
functions/methods to assign to class attributes when the class is
constructed. There is some overhead from the conditions, but only
while evaluating __init__.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant