TACC / Lmod

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

RFE: Honor MODULES_AUTO_HANDLING #680

Open opoplawski opened 7 months ago

opoplawski commented 7 months ago

Describe the bug TCL Environment Modules has a MODULES_AUTO_HANDLING environment variable described here: https://modules.readthedocs.io/en/latest/module.html#envvar-MODULES_AUTO_HANDLING

It would be helpful if Lmod supported it.

To Reproduce

export MODULES_AUTO_HANDLING=1
ml intel/2024.0.0
Lmod has detected the following error: Cannot load module "compiler/2024.0.0". At least one of
these module(s) must be loaded:
   tbb

While processing the following module(s):
    Module fullname    Module Filename
    ---------------    ---------------
    compiler/2024.0.0  /opt/ohpc/pub/moduledeps/oneapi/compiler/2024.0.0
    intel/2024.0.0     /opt/ohpc/pub/modulefiles/intel/2024.0.0

Expected behavior The prereqs for intel/2024.0.0 are loaded automatically.

Desktop (please complete the following information):

Changes from Default Configuration

Name Where Set Default Value


LFS_VERSION D 1.6.3 1.8.0 LMOD_AUTO_SWAP C yes no LMOD_COLORIZE E yes no LMOD_PACKAGE_PATH D nil <empt y> LMOD_PAGER C less /usr/ bin/more LMOD_REDIRECT C no yes LMOD_SITEPACKAGE_LOCATION Other /opt/ohpc/admin/lmod/8.7.32/libexec/SitePackage.lua <srct ree> LMOD_SYSTEM_DEFAULT_MODULES D unknown <empt y> LMOD_TCLSH C tclsh /usr/ bin/tclsh MODULEPATH_ROOT C /opt/ ohpc/admin/modulefiles PATH_TO_LUA C lua /usr/ bin/lua

Where Set -> D: default, E: environment, C: configuration lmod_cfg: lmod_config.lua SitePkg: SitePackage StdPkg: StandardPackage Other: Set somewhere outside of normal locations


**Additional context**
Intel changed they way they are expressing module deps - see https://community.intel.com/t5/Intel-oneAPI-Base-Toolkit/Why-the-change-to-module-prerequisites-with-2024-compiler/m-p/1550044
rtmclay commented 3 weeks ago

Supporting setting MODULES_AUTO_HANDLING is now available for testing on the PR680 branch. When this variable is set. Lmod treats prereq() as depends_on() and prereq_any() and *depends_on_any()*

Adding this feature was complicated. The problem was that prereq_any had to map to depends_on_any() and depends_on_any() did not exist. Handling how depends_on_any() would unload required re-thinking how the internals of Lmod works.

rtmclay commented 1 week ago

O.K. to close this issue?

opoplawski commented 1 week ago

I'm not quite sure I follow. Wouldn't this get closed automatically when you merged the fix? Is there a PR for the branch yet? Or should I build a local version with just that branch for testing?

rtmclay commented 1 week ago

I use PR# to be the name of branch to be the code changes for a particular issue. You can test branch PR680 to see if it works for you.