I did a test with my example and I got this message :
>>>> module load moduleA/1.0
>>>> module load moduleB/1.0
Lmod has detected the following error: Your site prevents the automatic swapping of modules with same
name. You must explicitly unload the loaded version of "moduleA" before you can load the new one. Use swap (or an
unload followed by a load) to do this:
$ module swap moduleA moduleA
Alternatively, you can set the environment variable LMOD_DISABLE_SAME_NAME_AUTOSWAP to "no" to re-enable same name
autoswapping.
While processing the following module(s):
Module fullname Module Filename
--------------- ---------------
moduleB/1.0
The message should be more comprehensive if the number of the version appears in the message (like $ module swap moduleA/1.0 moduleA/2.0) ??
I find how to do that : in the file lmod/lmod/libexec/Master.lua, I did two modifications line 281 and 284 of the 7.1.5 lmod version.
Before : if (LMOD_DISABLE_SAME_NAME_AUTOSWAP == "yes" and mt_version ~= version) then
LmodError("Your site prevents the automatic swapping of modules with same name.",
"You must explicitly unload the loaded version of \"",sn,"\" before",
"you can load the new one. Use swap (or an unload followed by a load)",
"to do this:\n\n",
" $ module swap ",sn," ",userName,"\n\n",
After : if (LMOD_DISABLE_SAME_NAME_AUTOSWAP == "yes" and mt_version ~= version) then
LmodError("Your site prevents the automatic swapping of modules with same name.",
"You must explicitly unload the loaded version of \"",sn.."/"..mt_version,"\" before",
"you can load the new one. Use swap (or an unload followed by a load)",
"to do this:\n\n",
" $ module swap ",sn.."/"..mt_version," ",userName.."/"..version,"\n\n",
After modification I obtain the message :
>>>> module load moduleA/1.0
>>>> module load moduleB/1.0
Lmod has detected the following error: Your site prevents the automatic swapping of modules with same
name. You must explicitly unload the loaded version of "moduleA/1.0" before you can load the new one. Use swap (or an
unload followed by a load) to do this:
$ module swap moduleA/1.0 moduleA/2.0
Alternatively, you can set the environment variable LMOD_DISABLE_SAME_NAME_AUTOSWAP to "no" to re-enable same name
autoswapping.
While processing the following module(s):
Module fullname Module Filename
--------------- ---------------
moduleB/1.0
Is it possible to add this modification to lmod if of course you think it's useful?
Do you know where I can find documentation about all variables like LMOD_DISABLE_SAME_NAME_AUTOSWAP?
Thank you
Lise
De : Lebouc Lise (CS SI) [mailto:Lis...@cn...]
Envoyé : jeudi 15 décembre 2016 14:55
À : Kenneth Hoste; lmo...@li...
Objet : Re: [Lmod-users] Disabling automatic unload/load when a module with an other version is already charged
Perfect !
Thank you !!!!
Lise
De : Kenneth Hoste [mailto:ken...@ug...]
Envoyé : jeudi 15 décembre 2016 14:47
À : lmo...@li...<mailto:lmo...@li...>
Objet : Re: [Lmod-users] Disabling automatic unload/load when a module with an other version is already charged
Hi Lise,
On 15/12/16 13:54, Lebouc Lise (CS SI) wrote:
Hi everybody !
There is an automatic unload/load when a module with an other version is already charged. Is it possible to disabling it?
For example, if I have 3 modules like :
1) moduleA/1.0
2) moduleA/2.0
3) moduleB/1.0 which depend on moduleA/2.0 : load ("moduleA/2.0")
Actually if I load moduleA/1.0 then moduleB/1.0, moduleA/1.0 is unload and the moduleA/2.0 is load. There is a message :
The following have been reloaded with a version change:
1) moduleA/1.0 => moduleA/2.0
Is it possible to prohibit the load of moduleA/2.0 because moduleA/1.0 is already loaded?
I tried with conflict and family but it's seem work only this different name of module.
You can configure Lmod not to print an error message rather than doing the auto-swap, either by passing --with-disableNameAutoSwap=yes when you're configuring the Lmod build/install, or by defining $LMOD_DISABLE_SAME_NAME_AUTOSWAP using "export LMOD_DISABLE_SAME_NAME_AUTOSWAP=yes".
regards,
Kenneth
|