-
Notifications
You must be signed in to change notification settings - Fork 110
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 while maintaing order #481
Comments
Due to the dependency management mechanisms replacing in-place is a hard task. I see two leads here:
This second solution requires a feature addition, described in #185. I can work on this for next version if there is any interest. |
Priority path would be useful for a different scenario, where you would want to ensure a specific module to be always placed first in the path. I'm inclined to the first solution being closer to what I was hoping to achieve. When the old paths are removed from env variable, the index position is saved and used as the location to swap in the paths from the new module. Could you suggest a sample or a template on how I can test this out? |
Some example based on your description of bar, baz and foo setting $ cat bar/0.1
#%Module
prereq foo
prepend-path LD_LIBRARY_PATH /opt/[module-info name]/lib
$ cat foo/0.1
#%Module
prereq baz
prepend-path LD_LIBRARY_PATH /opt/[module-info name]/lib
$ cat foo/0.2
#%Module
prereq baz
prepend-path LD_LIBRARY_PATH /opt/[module-info name]/lib
$ cat baz/0.1
#%Module
prepend-path LD_LIBRARY_PATH /opt/[module-info name]/lib $ module load bar
Loading bar/0.1
Loading requirement: baz/0.1 foo/0.2
$ echo $LD_LIBRARY_PATH
/opt/bar/0.1/lib:/opt/foo/0.2/lib:/opt/baz/0.1/lib
$ module switch foo/0.2 foo/0.1
Switching from foo/0.2 to foo/0.1
Unloading dependent: bar/0.1
Unloading useless requirement: baz/0.1
Loading requirement: baz/0.1
Reloading dependent: bar/0.1
$ echo $LD_LIBRARY_PATH
/opt/bar/0.1/lib:/opt/foo/0.1/lib:/opt/baz/0.1/lib
$ module list
Currently Loaded Modulefiles:
1) baz/0.1 2) foo/0.1 3) bar/0.1 Dependency order can be reversed if path are added to See also optional requirements capabilities to be able to unload a module without unloading modules that depend on it. |
I am closing this issue since:
|
When one swaps modules, it would be helpful if there was a way to replace the relevant paths of the particular module is replaced in place maintaining path order.
module switch foo/0.1 foo/0.2
does this,
LD_LIBRARY_PATH=:/opt/foo/0.2/lib:/opt/bar/0.1/lib:/opt/baz/0.1/lib
instead of
LD_LIBRARY_PATH=/opt/bar/0.1/lib:/opt/foo/0.2/lib:/opt/baz/0.1/lib
Any thoughts on how this can be supported?
The text was updated successfully, but these errors were encountered: