TACC / Lmod

Lmod: An Environment Module System based on Lua, Reads TCL Modules, Supports a Software Hierarchy
http://lmod.readthedocs.org
Other
487 stars 126 forks source link

Tracking module usage: direct load vs load as dependency #465

Closed mpigou closed 4 years ago

mpigou commented 4 years ago

Hi,

I am using Lmod along-with Easybuild to set-up a module environment for scientific computations in my lab and I followed the documentation to implement a module usage tracking to know which modules are actively used and this is working correctly so far. However, if a user loads a module which has dependencies, I am not able to differentiate the module that has been directly requested by the user from those who were only dependencies. Is such a differentiation currently possible? If not, would that be possible to add a load_request hook which is triggered for each module a user tries to load, or to add supplementary field to load_hook input table argument which indicates whether the module is a direct user request, or a module which is only loaded as the dependency of another one?

A reason why I'd like to have this behavior is to know whether a module is directly used by users, or if it is only ever loaded as a dependency. As we have hundreds of modules, we would like to restrict the visible module list to the bare minimum but we do not yet know which modules users want to access directly.

Thanks for your help!

wpoely86 commented 4 years ago

Can you find an example on how to log that in https://github.com/TACC/Lmod/blob/master/contrib/more_hooks/SitePackage.lua#L45

mpigou commented 4 years ago

Thank you! I did not know about these supplementary hook examples.