Skip to content

Commit

Permalink
Merge branch 'master' of bitbucket.org:rtmclay/lmod
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert McLay committed Sep 9, 2021
2 parents 8d64851 + 2337db6 commit 3498a48
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 24 deletions.
2 changes: 1 addition & 1 deletion my_docs/21/lmod_zoom_mtg_2021_09_07/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TALKS := talk.pdf
TALKS := presentation.pdf
TEX_SUFS := .aux .log .nav .out .snm .toc .vrb .fdb_latexmk .fls

%.pdf:%.tex
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ \section{Introduction}
\frametitle{Compute Canada}
\begin{itemize}
\item https://github.com/ComputeCanada/software-stack-config/blob/main/lmod/SitePackage.lua\#L261-L272
{\small
{\tiny
\begin{semiverbatim}
local function load\_hook(t)
local valid = validate\_license(t)
Expand All @@ -131,6 +131,11 @@ \section{Introduction}
end
\end{semiverbatim}
}
\item Setting families: https://github.com/ComputeCanada/software-stack-config/blob/main/lmod/SitePackage\_families.lua
\item Logging code:
https://github.com/ComputeCanada/software-stack-config/blob/main/lmod/SitePackage\_logging.lua
\item Module properties https://github.com/ComputeCanada/software-stack-config/blob/main/lmod/SitePackage\_properties.lua
\item https://github.com/ComputeCanada/software-stack-config/blob/main/lmod/SitePackage\_visible.lua
\end{itemize}
\end{frame}

Expand All @@ -147,24 +152,36 @@ \section{Introduction}
\begin{frame}{Basic hooks}
\begin{itemize}
\item load hook - Called on every load
\item avail - Map directories into labels: https://lmod.readthedocs.io/en/latest/200\_avail\_custom.html
\item avail - Map directories into labels
\item startup - called at startup
\item finalize - called just before Lmod is about to finish
\item isVisibleHook - Reports whether a module should be visible
or not to avail and spider.
\item SiteName - Hook to specify Site Name (\emph{site}\_FAMILY\_\emph{something}) for family prefix
to avail and spider.
\item SiteName - Hook to specify Site Name
(\emph{site}\_FAMILY\_\emph{something}) for family prefix for
hierarchical module layout: TACC\_FAMILY\_COMPILER
\end{itemize}
\end{frame}

% page 13
\begin{frame}{isVisibleHook}
\begin{itemize}
\item isVisibleHook(modT): Reports whether a module should be visible
to avail and spider.
\item modT=\{fullName=..., sn=..., fn=...\}
\item Where fullName is name/version, sn = name and fn is fileName
\end{itemize}
\end{frame}

% page 14
\begin{frame}{Shared Home Filesystem hook}
\begin{itemize}
\item groupName - This hook adds the arch and os name to
moduleT.lua to make it safe on shared filesystems.
\end{itemize}
\end{frame}

% page 14
% page 15
\begin{frame}{Advanced Hooks}
\begin{itemize}
\item unload - Called on every unload
Expand All @@ -179,7 +196,7 @@ \section{Introduction}
\end{itemize}
\end{frame}

% page 15
% page 16
\begin{frame}{HookArray}
\begin{itemize}
\item A module can load other modules
Expand All @@ -190,7 +207,7 @@ \section{Introduction}
\end{itemize}
\end{frame}

% page 16
% page 17
\begin{frame}[fragile]
\frametitle{Contrib/TACC/SitePackage.lua: }
{\tiny
Expand Down Expand Up @@ -224,12 +241,13 @@ \section{Introduction}
\end{frame}
% page 17
% page 18
\begin{frame}{Other hooks in the documentation}
\begin{itemize}
\item Avail: https://lmod.readthedocs.io/en/latest/200_avail_custom.html
\item msgHook: https://lmod.readthedocs.io/en/latest/170_hooks.html
\item Avail: https://lmod.readthedocs.io/en/latest/200\_avail\_custom.html
\item msgHook: https://lmod.readthedocs.io/en/latest/170\_hooks.html
\end{itemize}
\end{frame}
\end{document}
2 changes: 1 addition & 1 deletion src/MName.lua
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ local function find_highest_by_key(self, key, fileA)
for j = 1,#a do
local entry = a[j]
local v = entry[key]
if (mrc:isVisible({fullName=entry.fullName,sn=entry.sn,fn=entry.fn}) or isMarked(v)) then
if (mrc:isVisible{fullName=entry.fullName,sn=entry.sn,fn=entry.fn} or isMarked(v)) then
if (v > weight) then
idx = j
weight = v
Expand Down
8 changes: 4 additions & 4 deletions src/ModuleA.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ function M.__find_all_defaults(self)
end

if (keepLooking) then
if (v.file and (show_hidden or mrc:isVisible({fullName=sn, sn=sn, fn=v.file}))) then
if (v.file and (show_hidden or mrc:isVisible{fullName=sn, sn=sn, fn=v.file})) then
defaultT[sn] = {weight = "999999999.*zfinal", fullName = sn, fn = v.file, count = 1}
elseif (next(v.fileT) ~= nil) then
for fullName, vv in pairs(v.fileT) do
local vis = mrc:isVisible({fullName=fullName, sn=sn, fn=vv.fn}) or isMarked(vv.wV)
local vis = mrc:isVisible{fullName=fullName, sn=sn, fn=vv.fn} or isMarked(vv.wV)
if (show_hidden or vis) then
count = count + 1
if (vis and (vv.wV > weight)) then
Expand Down Expand Up @@ -371,14 +371,14 @@ function M.build_availA(self)
local function l_build_availA_helper(mpath, sn, v, A)
local icnt = #A
if (v.file ) then
if (show_hidden or mrc:isVisible({fullName=sn,sn=sn,fn=v.file})) then
if (show_hidden or mrc:isVisible{fullName=sn,sn=sn,fn=v.file}) then
local metaModuleT = v.metaModuleT or {}
A[icnt+1] = { fullName = sn, pV = sn, fn = v.file, sn = sn, propT = metaModuleT.propT}
end
end
if (next(v.fileT) ~= nil) then
for fullName, vv in pairs(v.fileT) do
if (show_hidden or mrc:isVisible({fullName=fullName,sn=sn,fn=vv.fn})) then
if (show_hidden or mrc:isVisible{fullName=fullName,sn=sn,fn=vv.fn}) then
icnt = icnt + 1
A[icnt] = { fullName = fullName, pV = pathJoin(sn,vv.pV), fn = vv.fn, sn = sn, propT = vv.propT}
end
Expand Down
12 changes: 6 additions & 6 deletions src/Spider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ function M.buildDbT(self, mpathA, mpathMapT, spiderT, dbT)
end
t.parentAA = parentT[mpath]
t.fullName = sn
t.hidden = not mrc:isVisible({fullName=sn, sn=sn, fn=v.file})
t.hidden = not mrc:isVisible{fullName=sn, sn=sn, fn=v.file}
T[v.file] = t
end
if (next(v.fileT) ~= nil) then
Expand All @@ -571,7 +571,7 @@ function M.buildDbT(self, mpathA, mpathMapT, spiderT, dbT)
end
t.parentAA = parentT[mpath]
t.fullName = fullName
t.hidden = not mrc:isVisible({fullName=fullName, sn=sn, fn=vv.fn})
t.hidden = not mrc:isVisible{fullName=fullName, sn=sn, fn=vv.fn}
if (not vv.dot_version) then
T[vv.fn] = t
end
Expand Down Expand Up @@ -618,7 +618,7 @@ function M.buildProvideByT(self, dbT, providedByT)
local mrc = MRC:singleton()
for sn, vv in pairs(dbT) do
for fullPath, v in pairs(vv) do
local hidden = not mrc:isVisible({fullName=v.fullName, sn=sn, fn=fullPath})
local hidden = not mrc:isVisible{fullName=v.fullName, sn=sn, fn=fullPath}
if (v.provides ~= nil) then
local providesA = v.provides
for i = 1, #providesA do
Expand Down Expand Up @@ -873,7 +873,7 @@ function M.spiderSearch(self, dbT, providedByT, userSearchPat, helpFlg)
if (T) then
dbg.print{"Have T\n"}
for fn, v in pairs(T) do
if (mrc:isVisible({fullName=v.fullName,fn=fn,sn=origUserSearchPat})) then
if (mrc:isVisible{fullName=v.fullName,fn=fn,sn=origUserSearchPat}) then
found = true
break
end
Expand Down Expand Up @@ -907,7 +907,7 @@ function M.spiderSearch(self, dbT, providedByT, userSearchPat, helpFlg)
local fullA = {}
for sn, vv in pairs(dbT) do
for fn, v in pairs(vv) do
if (show_hidden or mrc:isVisible({fullName=v.fullName,sn=sn,fn=fn})) then
if (show_hidden or mrc:isVisible{fullName=v.fullName,sn=sn,fn=fn}) then
fullA[#fullA+1] = {sn=sn, fullName=v.fullName}
end
end
Expand Down Expand Up @@ -1017,7 +1017,7 @@ function M._Level1(self, dbT, providedByT, possibleA, sn, key, helpFlg)
dbg.print{"Have T in countEntries\n"}
dbg.print{"key: ",key,"\n"}
for fn, v in pairs(T) do
if (show_hidden or mrc:isVisible({fullName=v.fullName,sn=sn,fn=fn})) then
if (show_hidden or mrc:isVisible{fullName=v.fullName,sn=sn,fn=fn}) then
if (v.fullName == key) then
aa[#aa + 1] = v
end
Expand Down
2 changes: 1 addition & 1 deletion src/check_module_tree_syntax.in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function walk_spiderT(spiderT, mt, mList, errorT)

if (next(v.fileT) ~= nil) then
for fullName, vv in pairs(v.fileT) do
if (show_hidden or mrc:isVisible({fullName=fullName,sn=sn,fn=vv.fn})) then
if (show_hidden or mrc:isVisible{fullName=fullName,sn=sn,fn=vv.fn}) then
check_syntax(mpath, mt, mList, sn, vv.fn, fullName, errorT.syntaxA)
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ end

function isActiveMFile(mrc, full, sn, fn)
local version = extractVersion(full, sn) or ""
return mrc:isVisible({fullName=full, sn=sn, fn=fn}), version
return mrc:isVisible{fullName=full, sn=sn, fn=fn}, version
end

-----------------------------------------------------------------------
Expand Down

0 comments on commit 3498a48

Please sign in to comment.