From a3de0cd696e11d8c2251c139fd8ff91d7a9e8d1b Mon Sep 17 00:00:00 2001 From: Brandon Cook Date: Thu, 19 Sep 2024 17:35:29 -0700 Subject: [PATCH 1/2] Cache conflicted_modules results --- reframe/core/modules.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reframe/core/modules.py b/reframe/core/modules.py index d29a47affd..70001faee9 100644 --- a/reframe/core/modules.py +++ b/reframe/core/modules.py @@ -8,6 +8,7 @@ # import abc +import functools import os import re from collections import OrderedDict @@ -1030,6 +1031,7 @@ def available_modules(self, substr): return ret + @functools.lru_cache def conflicted_modules(self, module): if module.collection: # Conflicts have no meaning in module collection. The modules From 32e50c20390373617e31010bae557d06fc8a4a35 Mon Sep 17 00:00:00 2001 From: Brandon Cook Date: Fri, 20 Sep 2024 16:22:33 -0700 Subject: [PATCH 2/2] fix: use decorator variant with arguments The variant of the decorator without arguments was added in Python 3.8. --- reframe/core/modules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reframe/core/modules.py b/reframe/core/modules.py index 70001faee9..e8c9c504b1 100644 --- a/reframe/core/modules.py +++ b/reframe/core/modules.py @@ -1031,7 +1031,7 @@ def available_modules(self, substr): return ret - @functools.lru_cache + @functools.lru_cache(maxsize=128) def conflicted_modules(self, module): if module.collection: # Conflicts have no meaning in module collection. The modules