You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From my understanding, when adding to the MODULEPATH (using --module-path or reframe.core.modules.ModulesSystem.searchpath_add()), reframe runs the equivalent of module use /path/to/modules/ in the reframe job and then launches the test job (e.g. using sbatch).
When sbatch uses --export=ALL (which is the default behaviour), MODULEPATH will remain changed in the test environment. However, I am running on a system where this behaviour has been changed and changes to the environment need to be present in the job script. Using prerun_cmds to run module use is also not ideal as these commands are injected after the modules are loaded in the job script.
Could the module use commands be added to the job script in the same way that module load commands are? This would also make the tests reproducible from the job scripts alone, and clearer where modules have been loaded from for a specific test.
The text was updated successfully, but these errors were encountered:
Indeed --module-path has a global effect on the ReFrame environment as it modifies the MODULEPATH globally. You can use the extended syntax for specifying modules both in the configuration and in a test:
{
"name": "module_name",
"path": "module_path"
}
ReFrame will issue a module use, module load and module unuse sequence for every such module.
Thanks, that is a useful workaround for now, however, if possible, I would like to do this without modifying the actual test code/configuration.
The full use case is that we have an existing test which uses central module files, but I want to run the same test as a one-off with a different installation of the module using my custom module file. I believe this is what --module-path would normally let you do?
Maybe you are right about propagating the --module-path globally in the job script.
For your case particularly I thought of another "valid" solution that does not touch the test. You can set the modules of your test directly from command line with -S modules=/path/to/new/module. You could also limit the assignment to your test specifically with -S test_name.modules=/path/to/new/module.
From my understanding, when adding to the MODULEPATH (using
--module-path
orreframe.core.modules.ModulesSystem.searchpath_add()
), reframe runs the equivalent ofmodule use /path/to/modules/
in the reframe job and then launches the test job (e.g. using sbatch).When sbatch uses
--export=ALL
(which is the default behaviour), MODULEPATH will remain changed in the test environment. However, I am running on a system where this behaviour has been changed and changes to the environment need to be present in the job script. Usingprerun_cmds
to runmodule use
is also not ideal as these commands are injected after the modules are loaded in the job script.Could the
module use
commands be added to the job script in the same way thatmodule load
commands are? This would also make the tests reproducible from the job scripts alone, and clearer where modules have been loaded from for a specific test.The text was updated successfully, but these errors were encountered: