Dear Danny,
Could you provide the whole modulefile, the command you run and loaded
module you get after running the commands. It would help to guide you.
When defining dependencies with "module load" or "prereq", it is
important not to enclose these commands within an evaluation mode test
(e.g., "if { [ module-info mode remove ] } {").
This way, what is done at load evaluation is reversed during unload.
Let's say you have "module load tbb" in your modulefile. tbb will get
loaded as a dependency when loading your module and it will be
automatically unloaded when unloading your module.
@Paul: I do not think there is a difference between using *-path
commands or "module use" in modulefile.
Best regards,
Xavier
Le ven. 6 oct. 2023 à 18:35, Paul Markfort <pau...@gm...> a écrit :
>
> Took me awhile to find it (module use, completely forgot what the command was, just remembered there was one), but you should use the "module use" or "module use --append" command to mess with MODULEPATH.
>
> My guess is those modules you are having trouble with, are in the /hpc/sw/modulefiles/nec/apps/intel_oneapi/.files_2023.2/ folder.
> (the module command can't find them to unload them).
>
> Hopefully, the implied "module unuse" command waits until the end of module processing to run (when the module unload is run, the module use becomes a module unuse).
>
> Xavier,
> May I suggest you update the man page so the append-path and prepend-path items suggest you use "module use" to modify MODULEPATH.
>
>
> On 10/6/2023 10:20 AM, Danny Sternkopf wrote:
> > Dear all,
> >
> > we have module which is loading quite few submodules. But when unloading it not all the dependent modules get unloaded. That's why we us a section like this:
> >
> > if { [ module-info mode remove ] } {
> > module unload tbb
> > module unload compiler-rt
> > module unload oclfpga
> > remove-path MODULEPATH /hpc/sw/modulefiles/nec/apps/intel_oneapi/.files_2023.2/
> > }
> >
> > I also tried with a "module-info mode unload" section, but there is no difference.
> >
> > We're using:
> > $ module --version
> > Modules Release 4.5.2 (2020-07-30)
> >
> > Should it work like this? Or is there something completely wrong here?
> >
> > The "module-info mode load" section works as expected btw.
> > if { [ module-info mode load ] } {
> > prepend-path MODULEPATH /hpc/sw/modulefiles/nec/apps/intel_oneapi/.files_2023.2/
> > }
> >
> > Thank you and Best regards,
> > Danny
|