Skip to content

Commit

Permalink
#222: Update caching (#225)
Browse files Browse the repository at this point in the history
Closes #222.
  • Loading branch information
ddundo authored Oct 24, 2024
1 parent 7a1bb67 commit fdd3bf5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ def pytest_runtest_teardown(item, nextitem):
"""
Clear caches after running a test
"""
from firedrake.tsfc_interface import TSFCKernel
from pyop2.global_kernel import GlobalKernel
from firedrake.tsfc_interface import clear_cache
from pyop2.caching import clear_memory_cache
from pyop2.mpi import COMM_WORLD

TSFCKernel._cache.clear()
GlobalKernel._cache.clear()
clear_cache()
clear_memory_cache(COMM_WORLD)
9 changes: 5 additions & 4 deletions test_adjoint/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,12 @@ def pytest_runtest_teardown(item, nextitem):
"""
Clear caches after running a test
"""
from firedrake.tsfc_interface import TSFCKernel
from pyop2.global_kernel import GlobalKernel
from firedrake.tsfc_interface import clear_cache
from pyop2.caching import clear_memory_cache
from pyop2.mpi import COMM_WORLD

TSFCKernel._cache.clear()
GlobalKernel._cache.clear()
clear_cache()
clear_memory_cache(COMM_WORLD)


@pytest.fixture(autouse=True)
Expand Down

0 comments on commit fdd3bf5

Please sign in to comment.