Skip to content

Test suite run over all tests takes long due to loading of ReFrame environments #344

Description

@casparvl

It takes a few minutes now to even list the tests for all tests in the test suite. Looking at the logs, I noticed the following:

[2026-07-10T14:03:42] debug: reframe: Validating '/home/casparvl/rfm.GkAMf7TaDb/test-suite/eessi/testsuite/tests/apps/walberla/__init__.py': not a test file
[2026-07-10T14:03:42] debug: reframe: Validating '/home/casparvl/rfm.GkAMf7TaDb/test-suite/eessi/testsuite/tests/apps/walberla/walberla.py': OK
[2026-07-10T14:03:42] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2023.06'
[2026-07-10T14:03:42] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2022b with regex waLBerla
[2026-07-10T14:03:42] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2023a with regex waLBerla
[2026-07-10T14:03:42] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2025.06'
[2026-07-10T14:03:42] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2023.06'
[2026-07-10T14:03:43] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2022b with regex waLBerla
[2026-07-10T14:03:43] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2023a with regex waLBerla
[2026-07-10T14:03:43] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2025.06'
[2026-07-10T14:03:43] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2023.06'
[2026-07-10T14:03:44] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2022b with regex waLBerla
[2026-07-10T14:03:44] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2023a with regex waLBerla
[2026-07-10T14:03:44] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2025.06'
[2026-07-10T14:03:44] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2023.06'
[2026-07-10T14:03:44] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2022b with regex waLBerla
[2026-07-10T14:03:44] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2023a with regex waLBerla
[2026-07-10T14:03:44] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2025.06'
[2026-07-10T14:03:45] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2023.06'
[2026-07-10T14:03:45] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2022b with regex waLBerla
[2026-07-10T14:03:45] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2023a with regex waLBerla
[2026-07-10T14:03:45] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2025.06'
[2026-07-10T14:03:46] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2023.06'
[2026-07-10T14:03:46] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2022b with regex waLBerla
[2026-07-10T14:03:46] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2023a with regex waLBerla
[2026-07-10T14:03:46] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2025.06'
[2026-07-10T14:03:46] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2023.06'
[2026-07-10T14:03:47] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2022b with regex waLBerla
[2026-07-10T14:03:47] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2023a with regex waLBerla
[2026-07-10T14:03:47] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2025.06'
[2026-07-10T14:03:47] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2023.06'
[2026-07-10T14:03:47] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2022b with regex waLBerla
[2026-07-10T14:03:47] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2023a with regex waLBerla
[2026-07-10T14:03:47] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2025.06'
[2026-07-10T14:03:48] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2023.06'
[2026-07-10T14:03:48] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2022b with regex waLBerla
[2026-07-10T14:03:48] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2023a with regex waLBerla
[2026-07-10T14:03:48] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2025.06'
[2026-07-10T14:03:49] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2023.06'
[2026-07-10T14:03:49] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2022b with regex waLBerla
[2026-07-10T14:03:49] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2023a with regex waLBerla
[2026-07-10T14:03:49] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2025.06'
[2026-07-10T14:03:49] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2023.06'
[2026-07-10T14:03:50] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2022b with regex waLBerla
[2026-07-10T14:03:50] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2023a with regex waLBerla
[2026-07-10T14:03:50] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2025.06'
[2026-07-10T14:03:50] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2023.06'
[2026-07-10T14:03:50] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2022b with regex waLBerla
[2026-07-10T14:03:50] debug: reframe: [find_modules]: Matched module waLBerla/6.1-foss-2023a with regex waLBerla
[2026-07-10T14:03:50] debug: reframe: [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2025.06'
[2026-07-10T14:03:51] verbose: reframe: Scales supported by EESSI_WALBERLA_BACKWARD_FACING_STEP: ('8_cores', '1_8_node', '1_4_node', '1_2_node', '1_node', '2_nodes')
[2026-07-10T14:03:51] debug: reframe: [filter_supported_scales]: valid_systems set to ['+8_cores']
[2026-07-10T14:03:51] debug: reframe: [set_module_names]: module_names set to ['waLBerla/6.1-foss-2022b']
[2026-07-10T14:03:51] debug: reframe: [filter_valid_systems_by_device_type]: valid_systems set to ['+8_cores +cpu'] for device type cpu
[2026-07-10T14:03:51] debug: reframe: [set_tag_scale]: tags set to {'8_cores'}
[2026-07-10T14:03:51] debug: reframe: [filter_supported_scales]: valid_systems set to ['+8_cores']
[2026-07-10T14:03:51] debug: reframe: [set_module_names]: module_names set to ['waLBerla/6.1-foss-2023a']
[2026-07-10T14:03:51] debug: reframe: [filter_valid_systems_by_device_type]: valid_systems set to ['+8_cores +cpu'] for device type cpu
[2026-07-10T14:03:51] debug: reframe: [set_tag_scale]: tags set to {'8_cores'}
...
[2026-07-10T14:03:52] debug: reframe: [set_module_names]: module_names set to ['waLBerla/6.1-foss-2023a']
[2026-07-10T14:03:52] debug: reframe: [filter_valid_systems_by_device_type]: valid_systems set to ['+2_nodes +cpu'] for device type cpu
[2026-07-10T14:03:52] debug: reframe: [set_tag_scale]: tags set to {'2_nodes'}
[2026-07-10T14:03:52] debug: reframe:   > Loaded 144 test(s)

In other words, just for waLBerla, it takes 10 seconds. Out of those 10 seconds, 8 seconds seem to be spent in find_modules, specifically (I think) in running [CMD] '/cvmfs/software.eessi.io/versions/2025.06/compat/linux/aarch64/usr/share/Lmod/libexec/lmod python load EESSI/2023.06' and similar. This command is executed 12 times, probably once per partition listed for this system.

I'm wondering if we can still optimize on this and make sure this doesn't happen.

Another thing to note is that even after that, it takes 2 more seconds to instantiate the 144 test instances (and some tests have way more instances, e.g. 1008 for MetalWalls, taking a whopping 10 seconds). OSU has over 5000 instances and takes a whopping minute to instantiate. I'm not sure if there is anything we can optimize here, maybe we can make sure that instantiation is skipped earlier in the pipeline for some very simple cases...

One potential point for improvement is that if someone asks -t 1_node that not all the scales are generated first... Another idea - although I know we've had issues with these in the past combined with EESSI_Mixin - is that we could make a hierarchy using fixtures. If the base class only does the scaling, and then already eliminates all but the 1_node scale before any of the more complex/heavy instantiation happens, that might save substantial time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions