Skip to content

Commit b237871

Browse files
committed
Do not print out lots of caching and object finalisation info in CI
It makes the output much harder to read and understand, especially since we already have interleaved output for the different jobs. It is also not very useful information for the vast majority of PRs.
1 parent 16ae07f commit b237871

3 files changed

Lines changed: 2 additions & 13 deletions

File tree

.github/workflows/core.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ jobs:
9191
OMP_NUM_THREADS: 1
9292
OPENBLAS_NUM_THREADS: 1
9393
FIREDRAKE_CI: 1
94-
PYOP2_CI_TESTS: 1
9594
PYOP2_SPMD_STRICT: 1
9695
# NOTE: One should occasionally update test_durations.json by running
9796
# 'make test_durations' inside a 'firedrake:latest' Docker image.

pyop2/caching.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
# in _KNOWN_CACHES
6262
_CACHE_CIDX = count()
6363
_KNOWN_CACHES = []
64-
# Flag for outputting information at the end of testing (do not abuse!)
65-
_running_on_ci = bool(os.environ.get('PYOP2_CI_TESTS'))
6664

6765

6866
# FIXME: (Later) Remove ObjectCached
@@ -265,10 +263,6 @@ def print_cache_stats(*args, **kwargs):
265263
print(hline)
266264

267265

268-
if _running_on_ci:
269-
print_cache_stats = atexit.register(print_cache_stats)
270-
271-
272266
class _CacheMiss:
273267
pass
274268

@@ -436,7 +430,7 @@ class DEFAULT_CACHE(dict):
436430
# EXOTIC_CACHE = partial(instrument(cachetools.LRUCache), maxsize=100)
437431

438432
# Turn on cache measurements if printing cache info is enabled
439-
if configuration["print_cache_info"] or _running_on_ci:
433+
if configuration["print_cache_info"]:
440434
DEFAULT_CACHE = instrument(DEFAULT_CACHE)
441435
DictLikeDiskAccess = instrument(DictLikeDiskAccess)
442436

pyop2/mpi.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@
7676
_DUPED_COMM_DICT = {}
7777
# Flag to indicate whether we are in cleanup (at exit)
7878
PYOP2_FINALIZED = False
79-
# Flag for outputting information at the end of testing (do not abuse!)
80-
_running_on_ci = bool(os.environ.get('PYOP2_CI_TESTS'))
8179

8280

8381
class PyOP2CommError(ValueError):
@@ -549,12 +547,10 @@ def finalize_safe_debug():
549547
finished writing debug information. In this case we fall back to using the
550548
Python `print` function to output debugging information.
551549
552-
Furthermore, we always want to see this finalization information when
553-
running the CI tests.
554550
'''
555551
global debug
556552
if PYOP2_FINALIZED:
557-
if logger.level > DEBUG and not _running_on_ci:
553+
if logger.level > DEBUG:
558554
debug = lambda string: None
559555
else:
560556
debug = lambda string: print(string)

0 commit comments

Comments
 (0)