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

Picking default version of a module based on compatibility with existing loaded modules #575

Closed
Micket opened this issue Apr 19, 2022 · 2 comments

Comments

@Micket
Copy link

Micket commented Apr 19, 2022

I'd like to have the behavior opposite of auto-swap when loading additional modules.

Creating a small example, with a shared Dependency and two software packages that use it:

mkdir modules
mkdir modules/Dependency
mkdir modules/SomeSoftware
mkdir modules/OtherSoftware
echo 'depends_on("Dependency/1.0")' > modules/SomeSoftware/1.2.lua
echo 'depends_on("Dependency/1.0")' > modules/OtherSoftware/2.3.lua
echo 'depends_on("Dependency/2.0")' > modules/OtherSoftware/3.4.lua

echo 'LmodMessage("Processing Dependency/1.0")' > modules/Dependency/1.0.lua
echo 'LmodMessage("Processing Dependency/2.0")' > modules/Dependency/2.0.lua

ml use modules

Here, we can see that SomeSoftware/1.2 is compatible with OtherSoftware/2.3 but not with OtherSoftware/3.4

Usage

module load SomeSoftware/1.2
module load OtherSoftware  # I'm not picky about the version

Currently, not specifying the version means Lmod translates this to the default (typically latest) version and only tries that. Here it would translate to OtherSoftware/3.4 which will fail to load as it isn't compatible (which is correct).

I was thinking since Lmod ought to have full dependency graph here (at least when depends_on is used), could it not figure out which versions of OtherSoftware that is compatible, if any, and simply opt to load that instead when it could? Perhaps with a printed warning.

Otherwise, you'll be forced as a user to figure out that OtherSoftware/2.3 is the compatible one, without any hints or indications.
It would mean a change to the behavior, so, a configuration option?

Perhaps this is already possible and I'm not wise enough to figure it out?

@rtmclay
Copy link
Member

rtmclay commented Jul 20, 2022

I don't know how to implement this. I would welcome a pull request on this issue.

@rtmclay
Copy link
Member

rtmclay commented Aug 18, 2022

I am closing this issue. If you have more information about this idea, please let me know.

@rtmclay rtmclay closed this as completed Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants