Taking the following modulefiles as example:
$ cat /path/to/modulefiles/rea
#%Module
$ cat /path/to/modulefiles/reb
#%Module
$ cat /path/to/modulefiles/red
#%Module
prereq rea reb
if {[module-info mode unload]} {
break
}
With following situation as starting point (rea and red modules loaded):
$ module load --auto red
Loading red
Loading requirement: rea
$ module list
Currently Loaded Modulefiles:
1) rea 2) red
When switching from rea to reb, an unload attempt of red occurs which fails as this modulefile breaks when it is unloaded. The unload of red is tried twice: once when rea is unloaded and a second time when reb is loaded. Second attempt could be spared.
$ module switch --auto rea reb
Unloading rea
ERROR: Reload of dependent red failed
$ module list
Currently Loaded Modulefiles:
1) rea 2) red
$ module switch --auto --force rea reb
Unloading rea
WARNING: Reload of dependent red failed
Loading reb
WARNING: Reload of dependent red failed
$ module list
Currently Loaded Modulefiles:
1) red 2) reb
Taking the following modulefiles as example:
With following situation as starting point (
reaandredmodules loaded):When switching from
reatoreb, an unload attempt ofredoccurs which fails as this modulefile breaks when it is unloaded. The unload ofredis tried twice: once whenreais unloaded and a second time whenrebis loaded. Second attempt could be spared.