diff --git a/python/dune/perftool/preambles.py b/python/dune/perftool/preambles.py index 828dbc13b26c3730f35f44ad05126d404b0a73aa..18c1a017ae9c180ab8e63e80ca4fb316a931d865 100644 --- a/python/dune/perftool/preambles.py +++ b/python/dune/perftool/preambles.py @@ -9,14 +9,14 @@ class UFL2LoopyDataCache(dict): """ The cache data structure The data is stored as key value pairs of the following form: - (function, cache_tuple) -> (code, priority_tag, preamble) + (function, cache_tuple) -> (content, priority_tag, preamble) The parameters are: function : the function that generates the preamble code snippet cache_tuple : A frozen (sub)set of arguments to the function. The map from function arguments to cache tuple controls the amount of caching. - code : The code snippet to generate. No assumptions made. + content : The content to store. No assumptions made. priority_tag : Will later decide the ordering of the preambles. preamble : A bool whether this cache entry does generate a loopy preamble. This is usually not the case, when you generate something @@ -26,8 +26,8 @@ class UFL2LoopyDataCache(dict): def __init__(self): self.counter = 0 - def register(self, cachekey, code, preamble): - self[cachekey] = (code, self.counter, preamble) + def register(self, cachekey, content, preamble): + self[cachekey] = (content, self.counter, preamble) self.counter = self.counter + 1 def extract_preambles(self): @@ -84,10 +84,10 @@ class _RegisteredFunction(object): if not self.generate_preamble: return _cache[cache_key][0] else: - code = self.func(*args) - _cache.register(cache_key, code, self.generate_preamble) + content = self.func(*args) + _cache.register(cache_key, content, self.generate_preamble) if not self.generate_preamble: - return code + return content def _dune_decorator_factory(**factory_kwargs):