Try:
module switch custom_verif custom_verif
Make sure you specify custom_verif twice (or it might unload some other module).
Also module switch will act as a module load if the module to unload is not loaded.
The issue, is the module command does not load a module that is already loaded (it doesn't know it is a different module).
A better way to handle this would be (since the two custom_verif modules likely make different changes):
module unload custom_verif
cd <new_folder>
module use --prepend `git rev-parse --show-toplevel`/setup/localmodules
module load custom_verif
Note: module unload won't complain if custom_verif is not loaded.
On 2026-03-09 11:22 AM, Laurent BESSON via lists.hpsf.io wrote:
> Hello dear Modules community,
>
> I have an issue with Modules not loading the « expected » modules files in my unix env. When I say « expected », I mean « the way I thought or would like to behav » 😊.
> Let me explain the context :
>
>
> * Modules version 5.5.0
> * Modules special configuration : module config conflict_unload 1
>
> My unix setup script is under Git and I have Modules files under this Git repo. Here is the beginning of this script :
>
> Cd <main branch>
> module use --prepend `git rev-parse --show-toplevel`/setup/localmodules
> module load custom_verif
>
> The « custom_verif » Modules is under Git and is located in <git root>/setup/localmodules
>
> Everything works fine when I start from a fresh terminal/shell or as long as I stay in the same directory.
>
> Now, the trouble comes when I change directory. Let’s say I have cloned another branch of the same project in another directory. I setup my shell to work in this new directory :
>
> Cd <some branch directory>
> module use --prepend `git rev-parse --show-toplevel`/setup/localmodules
> module load custom_verif
>
> In that case, « custom_verif » module is not unloaded/reloaded and I keep the content of « custom_verif » as it has been defined in the « main » directory but not in the « some branch » directory. Said another way, I see « custom_verif » in the $LOADEDMODULES variable (this is normal and expected) and I see the old « <main branch>/setup/localmodules/custom_verif » in $_LMFILES_. I was expecting to see « <some branch>/setup/localmodules/custom_verif » in this $_LMFILES_
>
> I was wondering if there is a trick/setup/configuration in Modules to make it understand the « custom_verif » module MUST BE reloaded in the new context (after the MODULEPATH have changed through « module use ») and must be used from the « branch » directory ?
>
> Thanks for your help,
> Laurent.
>
>
>
>
>
>
>
--
--------------------------------------------------------
The views and opinions expressed above are strictly
those of the author(s). The content of this message has
not been reviewed nor approved by any entity whatsoever.
--------------------------------------------------------
Paul FM Info: http://paulfm.com/~paulfm/
--------------------------------------------------------
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#21): https://lists.hpsf.io/g/modules-interest/message/21
Mute This Topic: https://lists.hpsf.io/mt/118224577/10150481
Group Owner: mod...@li...
Unsubscribe: https://lists.hpsf.io/g/modules-interest/unsub [mod...@li...]
-=-=-=-=-=-=-=-=-=-=-=-
|