Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the module path for tests does not work when --export=ALL not used with sbatch #3245

Open
NMannall opened this issue Aug 13, 2024 · 3 comments

Comments

@NMannall
Copy link

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.

@vkarak
Copy link
Contributor

vkarak commented Aug 14, 2024

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.

@NMannall
Copy link
Author

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?

@vkarak
Copy link
Contributor

vkarak commented Oct 3, 2024

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.

@vkarak vkarak added this to the ReFrame 4.8 milestone Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants