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

Add QUATERNIONIC_DISABLE_CACHE environment variable. #47

Merged
merged 2 commits into from
Aug 20, 2024
Merged

Add QUATERNIONIC_DISABLE_CACHE environment variable. #47

merged 2 commits into from
Aug 20, 2024

Conversation

bcbnz
Copy link
Contributor

@bcbnz bcbnz commented Aug 20, 2024

It may not always be desirable to cache the Numba-generated code, for example in a HPC environment where having lots of workers each compiling the code may be preferable to them all trying to load it from the cache.

This adds a QUATERNIONIC_DISABLE_CACHE environment variable. If set to 1, the cache parameter of the jit and guvectorize decorators is set to False. Default behaviour remains the same as before, i.e., to use the cache.

For the record, I have also made a pull request to Numba (numba/numba#9702) adding a environment variable to disable all caching. I figured that having the option just to disable it in quaternionic may be useful (and also, quaternionic would be quicker to have a release containing it allowing me to use it in my application sooner!).

It may not always be desirable to cache the Numba-generated code, for
example in a HPC environment where having lots of workers each compiling
the code may be preferable to them all trying to load it from the cache.

This adds a QUATERNIONIC_DISABLE_CACHE environment variable. If set to
1, the `cache` parameter of the `jit` and `guvectorize` decorators is
set to False. Default behaviour remains the same as before, i.e., to
use the cache.
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.90%. Comparing base (efe0480) to head (e8263ec).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #47   +/-   ##
=======================================
  Coverage   97.90%   97.90%           
=======================================
  Files          10       10           
  Lines        1096     1098    +2     
  Branches      230      230           
=======================================
+ Hits         1073     1075    +2     
  Misses         21       21           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@moble moble merged commit 5fe7df3 into moble:main Aug 20, 2024
9 checks passed
@moble
Copy link
Owner

moble commented Aug 20, 2024

Thanks very much! This is a very helpful and complete contribution. I appreciate it.

@bcbnz bcbnz deleted the env-disable-cache branch August 21, 2024 07:25
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.

2 participants