THE LINUX FOUNDATION PROJECTS
Submit your Speaking Proposal for the HPSF Conference · Deadline: Jan 17, 2027 · SUBMIT TODAY
Blog

Environment Modules 5.7: 2.7x Faster Loads, Stable Hooks, and Now Steered in the Open

By September 22, 2026No Comments

HPSF Modules

By Xavier Delaruelle (CEA) and Adrien Cotte (AS+), Modules Maintainers

The Modules team is happy to announce the release of Environment Modules 5.7!

Environment Modules is the module command that HPC users have typed for more than thirty years to switch between compilers, MPI libraries and applications. Version 5.7 is its first feature release since the project joined the High Performance Software Foundation (HPSF), and it comes with a clear theme: make module noticeably faster on large software stacks, and give site administrators clean, supported ways to bend it to their needs instead of patching its internals.

It is backward-compatible with previous version 5 releases. Here is what stands out.

Faster evaluation on large software stacks

Sites that load a hundred or more modulefiles in a single command, or that keep hundreds of versions of the same package side by side, reported that module could feel sluggish. Modules 5.7 attacks this from several angles:

  • In-memory caching of expensive operations such as module specification comparisons.
  • Reworked environment synchronization between the Tcl interpreters used to evaluate modulefiles, now relying on Tcl’s own mechanisms rather than a custom re-implementation.
  • Narrower dependency checks: conflict and requirement verifications only compare against the loaded modules sharing the same root name.
  • Lighter-weight name/version resolution: loading an exact version out of a directory holding hundreds or thousands of sibling versions no longer validates every one of them to settle the implicit default and latest symbolic versions.
  • Simpler column layout for avail and list output, dropping a costly optimization that tried to squeeze in extra columns.

The project’s benchmark utility was extended with scenarios that load 137 modulefiles, list them and purge them. On local flash storage:

 

Benchmark v5.6.1 v5.7.0
load 137 modules 1038 ms 384 ms (-63%)
list 137 modules 222 ms 29 ms (-87%)
purge 137 modules 568 ms 303 ms (-46%)
load 1 of 500 versions 30 ms 19 ms (-36%)

For sites with very large module caches, the new ignore_cache_subcmds configuration option lets targeted sub-commands like load walk the modulepath directly instead of evaluating a multi-megabyte cache file, while listing sub-commands keep benefiting from the cache.

New knobs for site administrators

Every site has its own conventions for environment variables. Modules 5.7 adds several configuration options so these conventions can be expressed once rather than repeated in every modulefile:

  • Linked environment variables (linked_envvars): mirror every change applied to one variable onto others. Link CPATH to INCLUDE_PATH and a single prepend-path CPATH in a modulefile updates both.
  • Initial values on first modification (init_envvars): assign a value to a variable the first time a modulefile touches it. The classic use case is keeping the trailing colon in MANPATH so system manual pages remain reachable.
  • Path entry reorder (path_entry_reorder): when a path entry is added again, move it to the front or the back instead of leaving the variable untouched.
  • Informational extensions, non-exportable tags, and a configurable domain name command round out the list.

Each option can be set at installation time, through module config, or with its corresponding MODULES_* environment variable.

Ignore what is not a modulefile

Modulepath directories may mix modulefiles with helper scripts or even the software trees they describe. Until now the only way to keep module away from such files was to prefix their name with a dot. The new modulepath-ignore rc command accepts gitignore-style patterns:

modulepath-ignore *.tcl soft/

Ignored files and directories are treated as if they did not exist: not checked, not walked down, not reported, and not recorded in cache files. Cache build time and size now scale with the number of actual modulefiles, however many other files live next to them. Negated patterns turn this into an ignore all, accept some logic:

modulepath-ignore * !*/ !*.mod

A stable hook API

Sites that needed to run code before or after a modulefile evaluation had to reach for the Tcl trace command or rename an internal procedure. Both bind to implementation details that could change from one release to the next, so every upgrade meant re-reading the internals.

Modules 5.7 introduces the add-hook siteconfig command with four stable, documented events: before-modulefile-eval, after-modulefile-eval, before-modulerc-eval and after-modulerc-eval. Several procedures can be registered on the same event and run in registration order. An error in a hook is reported but never aborts the running module command.

proc auditRequestedLoad {modfile modname modnamevr modspec mode requested} {
   if {$requested && $mode eq {load}} {
      set fd [open /var/log/modules-audit.log a]
      puts $fd "[clock format [clock seconds]] $modnamevr"
      close $fd
   }
}
add-hook before-modulefile-eval auditRequestedLoad

These four events are a starting point. A contributor guide explains how to propose new ones as real site needs come up.

Python, Windows, and everyday usability

  • The Python initialization script is renamed to env_modules.py, a valid Python module name, and the Modules init directory is added to PYTHONPATH so import env_modules just works. A new --with-pythondir installation option can place it alongside the other Python modules of the system.
  • On Windows, the system-wide PATH is now persisted with reg add instead of setx, which silently truncates values at 1024 characters. Setting up a Windows Terminal profile is documented as an install-script-free alternative.
  • -p and -P are short forms of --paginate and --no-pager, and the new paginate configuration option sets the default.
  • avail and spider report the full via path of a module, with JSON output exposing it as an array.
  • sh-to-mod and source-sh handle recent Dash and Fish releases and produce more faithful prepend-path/append-path translations.
  • The getenv modulefile command is now available from modulerc files.
  • A new modulecmd(1) manual page documents the underlying command.

Documentation for users, admins, and contributors

The new Lesser known features user guide walks through the capabilities that sit beyond module load: short command names, output filtering, variants, stashing environments, and more. It grew out of the Beyond “module load” session given at HPSFCon 2026.

On the contributor side, the release adds design notes for every major mechanism above, guides on the DejaGnu testsuite and continuous integration, commit-message and code-comment conventions, and adopts the Linux kernel policy on AI coding assistants: their involvement must be disclosed with an Assisted-by: trailer and they never sign off on a change.

A project steered in the open

Modules 5.7 is the first feature release shipped since the project joined HPSF, and it lands in a project that looks quite different from a year ago.

Modules now has a documented open governance and a Technical Steering Committee that has met publicly every quarter since the beginning of 2026. Meetings are announced on the project wiki, listed on the HPSF public calendar, and anyone interested in the project can join.

The project also has two maintainers: Adrien Cotte (AS+) has joined Xavier Delaruelle (CEA). Both attended HPSFCon 2026 in Chicago last March and hosted the first Modules project session there. The exchanges with users and site administrators were very fruitful: they clarified what matters most in daily operations and are feeding the feature requests for future releases.

The modules-interest mailing list has moved to lists.hpsf.io, and the #modules:matrix.org chat room is open for quicker exchanges. The project is actively looking for additional contributors. If you run Modules at your site and want a say in where it goes, the door is open.

Get Modules 5.7

Modules 5.7 is available for download today. We invite the community to upgrade, try the new features and tell us what they change for you.