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

'module switch mod mod/vers' denies load of swapped-on module #355

Closed
xdelaruelle opened this issue Aug 10, 2020 · 1 comment
Closed

'module switch mod mod/vers' denies load of swapped-on module #355

xdelaruelle opened this issue Aug 10, 2020 · 1 comment
Labels
Milestone

Comments

@xdelaruelle
Copy link
Member

module switch command is sometimes used in modulefile to ensure a specific version of a module requirement will be loaded, whatever the current environment state.

In this case a module switch foo foo/1.2 command is set in a bar/1 module means that foo/1.2 is required by bar/1 and this foo/1.2 version should replace any version of foo currently loaded version.

Consistency mechanism introduced in version 4.2 of Modules currently breaks this use case:

$ cat /path/to/modulefiles/bar/1
#%Module
module switch foo foo/1.2
$ module load bar/1
Loading foo/1.2
  ERROR: Conflicting 'bar/1' is loading

Loading bar/1
  WARNING: Load of switched-on foo/1.2 failed
  ERROR: Load of requirement 'foo/1.2' failed

Any version of foo is declared conflicting with bar/1 which breaks the load of swapped-on module foo/1.2.

Consistency mechanism should be adapted to allow such use case. For instance if the specification of the module to swap-off matches the specification of the module to swap-on, do not define a conflict against swapped-off module.

@xdelaruelle
Copy link
Member Author

Such use case is used in modulefiles generated by EasyBuild (easybuilders/easybuild-framework#3396).

@xdelaruelle xdelaruelle added this to the 4.5.3 milestone Aug 11, 2020
xdelaruelle added a commit to xdelaruelle/modules that referenced this issue Aug 11, 2020
`module switch` command used in modulefile is sometimes used to ensure a
given version of a module is loaded. Currently loaded version of this
module is unloaded to replace it by the designated specific version.
This use case does not cope with the conflict declaration that is set
over switched-off module specification. To support this use case,
conflict definition is skipped if swapped-off module specification
matches (includes) swapped-on module specification.

Fixes cea-hpc#355
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant