duetosymmetry / qnm

Python package for computing Kerr quasinormal mode frequencies, separation constants, and spherical-spheroidal mixing coefficients
https://qnm.readthedocs.io
MIT License
39 stars 19 forks source link

Add numba signatures to @njit decorators for eager compilation at import-time #15

Closed duetosymmetry closed 5 years ago

duetosymmetry commented 5 years ago

These can be found by inspecting <jitted function>.nopython_signatures.

duetosymmetry commented 5 years ago

With more testing, it seems that adding type signatures for AOT compilation will disable JIT compilation for those same functions. This is restrictive for leaver_cf_inv_lentz which has optional arguments, and would thus require a large number of signatures to ensure completeness. More thinking required.

duetosymmetry commented 5 years ago

Instead of adding signatures, we now trigger compilation (of a few signatures) by simply calling functions in _ensure_jitted() at load time (in this commit: https://github.com/duetosymmetry/qnm/commit/d607ecf157fd6223395de8f58bc2b34ad6d88e89#diff-0a30e0294996e44b2bacc826a9e41f94)