| 1 |
\documentclass{beamer} |
| 2 |
|
| 3 |
% You can also use a 16:9 aspect ratio: |
| 4 |
%\documentclass[aspectratio=169]{beamer} |
| 5 |
\usetheme{TACC16} |
| 6 |
|
| 7 |
% It's possible to move the footer to the right: |
| 8 |
%\usetheme[rightfooter]{TACC16} |
| 9 |
|
| 10 |
%% page |
| 11 |
%\begin{frame}{} |
| 12 |
% \begin{itemize} |
| 13 |
% \item |
| 14 |
% \end{itemize} |
| 15 |
%\end{frame} |
| 16 |
% |
| 17 |
%% page |
| 18 |
%\begin{frame}[fragile] |
| 19 |
% \frametitle{} |
| 20 |
% {\tiny |
| 21 |
% \begin{semiverbatim} |
| 22 |
% \end{semiverbatim} |
| 23 |
%} |
| 24 |
% \begin{itemize} |
| 25 |
% \item |
| 26 |
% \end{itemize} |
| 27 |
% |
| 28 |
%\end{frame} |
| 29 |
|
| 30 |
\begin{document} |
| 31 |
\title[Lmod]{How Lmod supports finding ``Highest'' and marked defaults |
| 32 |
in one step} |
| 33 |
\author{Robert McLay} |
| 34 |
\date{July 11, 2023} |
| 35 |
|
| 36 |
% page 1 |
| 37 |
\frame{\titlepage} |
| 38 |
|
| 39 |
|
| 40 |
% page 2 |
| 41 |
\begin{frame}{Outline} |
| 42 |
\center{\includegraphics[width=.9\textwidth]{[email protected]}} |
| 43 |
\begin{itemize} |
| 44 |
\item Lmod supports ``module load name'' as well as ``module load |
| 45 |
name/version'' |
| 46 |
\item In Lmod, fullName: ``name/version'', version: ``version'' |
| 47 |
and shortName: ``name'' |
| 48 |
\item So how does pick a version when there is no version specified? |
| 49 |
\end{itemize} |
| 50 |
\end{frame} |
| 51 |
|
| 52 |
% page 3 |
| 53 |
\begin{frame}{What rules does Lmod use to pick a default?} |
| 54 |
\begin{enumerate} |
| 55 |
\item Pick highest priority marked default if it exists. |
| 56 |
\item Otherwise pick the ``highest'' version. |
| 57 |
\end{enumerate} |
| 58 |
\end{frame} |
| 59 |
|
| 60 |
% page 4 |
| 61 |
\begin{frame}{How does Lmod sort versions?} |
| 62 |
\begin{itemize} |
| 63 |
\item Karl Schultz (TACC $\Rightarrow$ Intel $\Rightarrow$ Open |
| 64 |
HPC $\Rightarrow$ AMD) asked |
| 65 |
\item Can't Lmod know 5.9 is older than 5.10? |
| 66 |
\item I stole the ideas in Python's loose version code to build src/parseVersion.lua |
| 67 |
\item It converts version 2.11b into |
| 68 |
``000000002.000000011.*b.*zfinal'' |
| 69 |
\item It knows how to handle things like alpha and beta. |
| 70 |
\item So versions are ordered: 1.1alpha $<$ 1.1beta $<$ 1.1 |
| 71 |
\item 1.1alpha: ``000000001.000000001.*alpha.*zfinal'', |
| 72 |
\item 1.1beta: ``000000001.000000001.*beta.*zfinal'', |
| 73 |
\item 1.1: ``000000001.000000001.*zfinal'', |
| 74 |
\end{itemize} |
| 75 |
\end{frame} |
| 76 |
|
| 77 |
% page 5 |
| 78 |
\begin{frame}{When there are no marked defaults?} |
| 79 |
\begin{itemize} |
| 80 |
\item For name/version (not name/version/version) Lmod collects |
| 81 |
all version across all \$MODULEPATH directories. |
| 82 |
\item Only the first ``acme/2.1'' is used. |
| 83 |
\item Lmod picked the highest ``pV'' as default |
| 84 |
\item for N/V/V only the first directory in \$MODULEPATH is used |
| 85 |
\end{itemize} |
| 86 |
\end{frame} |
| 87 |
|
| 88 |
% page 6 |
| 89 |
\begin{frame}{What if there marked defaults for shortName?} |
| 90 |
\begin{itemize} |
| 91 |
\item Suppose acme/2.1, acme/2.2 and acme/2.3 exist and 2.1 is the |
| 92 |
marked default? |
| 93 |
\item How does Lmod chose? |
| 94 |
\item Does it look for marked defaults first then highest? |
| 95 |
\end{itemize} |
| 96 |
\end{frame} |
| 97 |
|
| 98 |
% page 7 |
| 99 |
\begin{frame}{Lmod modifies pV $\Rightarrow$ wV} |
| 100 |
\begin{itemize} |
| 101 |
\item Lmod collects all version for ``acme'' |
| 102 |
\item It builts pV for each version |
| 103 |
\item Then it modifies pV to become wV (weighted version) |
| 104 |
\item By applying any marked defaults |
| 105 |
\end{itemize} |
| 106 |
\end{frame} |
| 107 |
|
| 108 |
% page 8 |
| 109 |
\begin{frame}{Three ways to mark a default} |
| 110 |
\begin{itemize} |
| 111 |
\item Lowest: filesystem: .version, .modulerc, or .modulerc.lua in version |
| 112 |
directory |
| 113 |
\item Medium: A System modulerc or modulerc.lua file |
| 114 |
\item Highest: A user \textasciitilde{}/.modulerc or \textasciitilde{}/.modulerc.lua |
| 115 |
\end{itemize} |
| 116 |
\end{frame} |
| 117 |
|
| 118 |
% page 9 |
| 119 |
\begin{frame}{Modifying pV $\Rightarrow$ wV} |
| 120 |
\begin{itemize} |
| 121 |
\item If ``acme/2.1'' is the marked default then |
| 122 |
\item Lmod replaces the first character with |
| 123 |
\item ``\^{}'' for filesystem |
| 124 |
\item ``s'' for System modulerc |
| 125 |
\item ``u'' for user modulerc |
| 126 |
\item For example a filesystem marked default becomes |
| 127 |
\item wV = "\^{}00000002.000000001.*zfinal" |
| 128 |
\end{itemize} |
| 129 |
\end{frame} |
| 130 |
|
| 131 |
% page 10 |
| 132 |
\begin{frame}{Using ascii sort order} |
| 133 |
\begin{itemize} |
| 134 |
\item Since ``u'' $>$ ``s'' $>$ ``\^{}'' $>$ numbers |
| 135 |
\item Then user $>$ system $>$ filesystem $>$ highest |
| 136 |
\item This is how Lmod picks the default |
| 137 |
\end{itemize} |
| 138 |
\end{frame} |
| 139 |
|
| 140 |
% page 11 |
| 141 |
\begin{frame}[fragile] |
| 142 |
\frametitle{This (wV) can be seen the the moduleTable} |
| 143 |
{\tiny |
| 144 |
\begin{semiverbatim} |
| 145 |
\$ module --mt # or ml --mt |
| 146 |
... |
| 147 |
acme = \{ |
| 148 |
fn = "/opt/apps/modulefiles/Core/acme/2.1.lua", |
| 149 |
fullName = "acme/2.1", |
| 150 |
loadOrder = 5, |
| 151 |
propT = \{\}, |
| 152 |
stackDepth = 1, |
| 153 |
status = "active", |
| 154 |
userName = "acme", |
| 155 |
wV = "^00000002.000000001.*zfinal", |
| 156 |
\}, |
| 157 |
|
| 158 |
\end{semiverbatim} |
| 159 |
} |
| 160 |
\end{frame} |
| 161 |
|
| 162 |
% page 12 |
| 163 |
\begin{frame}{Conclusions} |
| 164 |
\begin{itemize} |
| 165 |
\item This is a potential bug if sites use versions more than 9 |
| 166 |
digits |
| 167 |
\item Version like 1.2.3.4.5.6.7.8.9.2.3 are ok |
| 168 |
\item Version like 12345678901.1 would be bad (but unlikely) |
| 169 |
\item Lmod could fix the by using more padding. |
| 170 |
\item Otherwise this is convenient way to find the default |
| 171 |
\end{itemize} |
| 172 |
\end{frame} |
| 173 |
|
| 174 |
% page 22 |
| 175 |
\begin{frame}{Future Topics} |
| 176 |
\begin{itemize} |
| 177 |
\item To be determined. |
| 178 |
\item Next Meeting will be August 1st at 9:30 Central (14:30 UTC) |
| 179 |
\end{itemize} |
| 180 |
\end{frame} |
| 181 |
|
| 182 |
\end{document} |