diff --git a/my_docs/21/lmod_zoom_mtg_2021_09_07/Makefile b/my_docs/21/lmod_zoom_mtg_2021_09_07/Makefile index ffdf6b6c8..1b3d94a9d 100644 --- a/my_docs/21/lmod_zoom_mtg_2021_09_07/Makefile +++ b/my_docs/21/lmod_zoom_mtg_2021_09_07/Makefile @@ -1,4 +1,4 @@ -TALKS := talk.pdf +TALKS := presentation.pdf TEX_SUFS := .aux .log .nav .out .snm .toc .vrb .fdb_latexmk .fls %.pdf:%.tex diff --git a/my_docs/21/lmod_zoom_mtg_2021_09_07/presentation.pdf b/my_docs/21/lmod_zoom_mtg_2021_09_07/presentation.pdf new file mode 100644 index 000000000..55b0254dc Binary files /dev/null and b/my_docs/21/lmod_zoom_mtg_2021_09_07/presentation.pdf differ diff --git a/my_docs/21/lmod_zoom_mtg_2021_09_07/talk.tex b/my_docs/21/lmod_zoom_mtg_2021_09_07/presentation.tex similarity index 83% rename from my_docs/21/lmod_zoom_mtg_2021_09_07/talk.tex rename to my_docs/21/lmod_zoom_mtg_2021_09_07/presentation.tex index 94f3076a4..c25c73028 100644 --- a/my_docs/21/lmod_zoom_mtg_2021_09_07/talk.tex +++ b/my_docs/21/lmod_zoom_mtg_2021_09_07/presentation.tex @@ -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) @@ -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} @@ -147,16 +152,28 @@ \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 @@ -164,7 +181,7 @@ \section{Introduction} \end{itemize} \end{frame} -% page 14 +% page 15 \begin{frame}{Advanced Hooks} \begin{itemize} \item unload - Called on every unload @@ -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 @@ -190,7 +207,7 @@ \section{Introduction} \end{itemize} \end{frame} -% page 16 +% page 17 \begin{frame}[fragile] \frametitle{Contrib/TACC/SitePackage.lua: } {\tiny @@ -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} diff --git a/src/MName.lua b/src/MName.lua index b1fab787d..17193df8b 100644 --- a/src/MName.lua +++ b/src/MName.lua @@ -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 diff --git a/src/ModuleA.lua b/src/ModuleA.lua index 21afe4bf1..89d7072cf 100644 --- a/src/ModuleA.lua +++ b/src/ModuleA.lua @@ -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 @@ -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 diff --git a/src/Spider.lua b/src/Spider.lua index 1fe542cfc..973f8c77e 100644 --- a/src/Spider.lua +++ b/src/Spider.lua @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/src/check_module_tree_syntax.in.lua b/src/check_module_tree_syntax.in.lua index 2cfbb7468..027e91230 100644 --- a/src/check_module_tree_syntax.in.lua +++ b/src/check_module_tree_syntax.in.lua @@ -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 diff --git a/src/utils.lua b/src/utils.lua index b501ddf10..439c4b78a 100644 --- a/src/utils.lua +++ b/src/utils.lua @@ -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 -----------------------------------------------------------------------