Refresh the Lmod spider cache¶
After a site install, module avail and module spider show the new module only when Lmod’s spider cache names it.
Lmod ignores a cache whose timestamp file is newer than spiderT.lua.
This page writes both, with the timestamp one second older.
Before you start¶
The module directories the site adds to
MODULEPATH, as absolute paths.A directory Lmod’s configuration reads as its cache directory, and the timestamp file that configuration names.
Lmod’s
spiderprogram onPATH, or its path for--spider.
lmod-cache does not read the site file, and it does not change a module.
Steps¶
Write the cache for one tree.
--modulepathis the same colon-separated list a user would have onMODULEPATH:eb-local lmod-cache \ --modulepath /opt/site/modules/all:/opt/site/modules/zen4 \ --cache-dir /opt/site/.lmod/cache \ --timestamp /opt/site/.lmod/system.txt
The command prints:
wrote /opt/site/.lmod/cache/spiderT.lua; /opt/site/.lmod/system.txt is older than itspiderT.luais whatspider -o spiderTwrote. The timestamp file’s modification time is one second earlier, which is the mark Lmod uses to trust the cache.To refresh every CPU target under an install prefix (and each target’s accelerator module trees), use
--prefixinstead. It runs Lmod’supdate_lmod_system_cache_filesonce per target, as the European Environment for Scientific Software Installations (EESSI) publisher scriptupdate_lmod_caches.shdoes:eb-local lmod-cache --prefix /opt/eessi-mirror eb-local lmod-cache --prefix /home/alice/eessi --eessi-version 2026.06 --dry-run
--dry-runprints each CPU target directory, its.lmod/cachepath and theMODULEPATHthat would be passed to the updater.Point Lmod at those two paths, in the
lmodrc.luathe site already loads. The cache directory is the directory that now holdsspiderT.lua, and the timestamp is the file named above.Run it again after the next install. A build pipeline can use the same command as its cache command, with the paths written out.
[caches].commandis not a shell, so the paths are absolute.
If it fails¶
Message |
Cause |
What to do |
|---|---|---|
|
Single-target mode without one of the three, and no |
Pass all three, or use |
|
|
Check the prefix or pass |
|
|
Pass absolute paths. The cache is read later from another working directory. |
|
|
Install Lmod, or pass |
|
|
Read the lines above that one, fix the module directories, and run it again. |
Next steps¶
Find what is wrong when a module still does not load.
Lmod’s system spider cache for the timestamp rule this command follows.