[Lmod-users] Lmod 7.6.14: Reference counting for path like variables
A Lua based environment module system that reads TCL modulefiles.
Brought to you by:
rtmclay
|
From: Robert M. <mc...@ta...> - 2017-09-11 19:54:18
|
The latest version of Lmod now support reference counting for path-like
variables when Lmod is configured normally. That is
$LMOD_DUPLICATE_PATHS=no (which is the default).
The documentation for PATH-like variables can be found here:
http://lmod.readthedocs.io/en/latest/077_ref_counting.html
This reference counting means that if your original PATH is:
export PATH=/usr/bin:/bin:/usr/local/bin
And a module FOO contains:
append_path("PATH","/usr/local/bin")
then doing:
$ module load FOO
Lmod will have
PATH=/usr/bin:/bin:/usr/local/bin
but it remembers that /usr/local/bin has been added twice. So unloading
FOO will keep
PATH=/usr/bin:/bin:/usr/local/bin
But the reference count on /usr/local/bin goes to one. This is different
that earlier behavior. Unloading the FOO module would have remove
/usr/local/bin from $PATH.
This is a new feature in Lmod but it is not a new feature in Env. Modules.
The pure TCL version of Tmod has had reference counting for path-like
variables for years.
-------------------------------------------------------
Special treatment for $MODULEPATH
-------------------------------------------------------
The MODULEPATH environment variable is treated special. No duplicates
entries are ever allowed. Also there no reference counting for PATH entries
stored in $MODULEPATH. Adding the same directory to $MODULEPATH will not
effect the reference count. It is always 1. This way a user can always
clear $MODULEPATH with:
$ module unuse $MODULEPATH
Please test out this new version if you get the chance. The version 7.6.14
is likely to become Lmod 7.7.
Thanks,
R.
--
Robert McLay, Ph.D.
TACC
Manager, HPC Software Tools
(512) 232-8104
|