Closed reuterbal closed 4 months ago
Documentation for this branch can be viewed at https://sites.ecmwf.int/docs/loki/315/index.html
This turned into quite a rabbit hole. Something in the original set of changes seems to have slightly skewed timings in the test execution, presumably due to the increased use of test-local temporary directories. The symptom was then random segfaults when garbage collection was triggered.
The subsequent investigation unearthed a few glaring holes in our JIT infrastructure for tests:
tmp_path
fixture more widely to curtail the creation of in-source test files further and avoid aliasing surprises.Obj
nodes that are used to build the dependency graph for library builds are cached. The cache index is, however, simply a "name", which defaults to the filepath stem. With our various parametrised tests, that generate variants of files with the same name in different temporary directories, we now hit aliasing issues because the full file path is not taken into account. This needs to be cleaned up properly, potentially using Scheduler infrastructure to derive these dependency graphs. For now, I introduced a cache cleaning mechanism, which is now triggered as part of the builder
fixtures after completing a test.tempdir
fixture in all tests by tmp_path
I'm afraid, the end result is now a fairly sizeable diff. Sorry!
Attention: Patch coverage is 98.65229%
with 5 lines
in your changes are missing coverage. Please review.
Project coverage is 95.11%. Comparing base (
5db17e5
) to head (b4decea
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The latest release of f90wrap includes module names in the name of generated interface routines (introduced in https://github.com/jameskermode/f90wrap/pull/215). This lets them grow quickly beyond the Fortran length limit of 63 characters for names, and gfortran (not even 13.2) does not allow to lift that limitation.
Therefore, I have shorted the module and routine names in the test base where the character limit was exceeded. In the process, I also introduced the use of
tempdir
fixtures more widely to ensure clean-up of test files is handled gracefully and the littering of the source directory is reduced.