urn:noticeable:projects:cbzeG7wTvAIqj21zbUmxEnvironment Modules Updatescea-hpc.github.io/modules2021-01-05T06:48:27.043ZCopyright © Environment ModulesNoticeablehttps://storage.noticeable.io/projects/cbzeG7wTvAIqj21zbUmx/newspages/UPOFxJbXsysxyt1L7iHB/01h55ta3gsp13j52cdnky8js2v-header-logo.pnghttps://storage.noticeable.io/projects/cbzeG7wTvAIqj21zbUmx/newspages/UPOFxJbXsysxyt1L7iHB/01h55ta3gsp13j52cdnky8js2v-header-logo.png#b70e0burn:noticeable:publications:sgRyDqAt3RJ3QltP84mu2021-01-05T05:59:00.001Z2021-01-05T06:48:27.043ZSymbolic version to designate module loaded versionWhen the Advanced module version specifiers is enabled, the loaded symbolic version may be used to designate the currently loaded version of specified module. $ ml display foo@loaded...<p>When the <a href="https://modules.readthedocs.io/en/latest/module.html?utm_source=noticeable&amp;utm_campaign=cbzeg7wtvaiqj21zbumx.symbolic-version-to-designate-module-loaded-version&amp;utm_content=publication+link&amp;utm_id=cbzeG7wTvAIqj21zbUmx.UPOFxJbXsysxyt1L7iHB.sgRyDqAt3RJ3QltP84mu&amp;utm_medium=newspage#advanced-module-version-specifiers" target="_blank" rel="noopener">Advanced module version specifiers</a> is enabled, the <code>loaded</code> symbolic version may be used to designate the currently loaded version of specified module.</p> <pre><code>$ ml display foo@loaded ------------------------------------------------------------------- /path/to/modulefiles/foo/1.0: module-whatis foo/1.0 ------------------------------------------------------------------- </code></pre> <p>If no version of specified module can be found loaded, an error is returned.</p> <pre><code>$ ml display foo@loaded ERROR: No loaded version found for 'foo' module </code></pre> Xavier Delaruelle[email protected]urn:noticeable:publications:caQ04KEApvo5WpZsPwkV2020-12-29T09:37:00.001Z2020-12-29T09:44:57.653ZDetermining module implementation and versionNew Modules variables are introduced to determine during the evaluation of a modulefile or a modulerc what module implementation is currently in use. The ModuleTool variable corresponds to the name of the module implementation and is set...<p>New Modules variables are introduced to determine during the evaluation of a modulefile or a modulerc what <em>module</em> implementation is currently in use. The <code>ModuleTool</code> variable corresponds to the name of the <em>module</em> implementation and is set to <code>Modules</code> for this project. The <code>ModuleToolVersion</code> variable corresponds to the version number of the implementation (e.g. <code>4.7.0</code>).</p> <p>With these new variables it is possible to precisely know what <em>module</em> command is in use then adapt modulefile code to handle a specific behavior or leverage a new feature.</p> <p>The modulefile command <code>versioncmp</code> is also introduced to provide a simple way to compare two version strings and return if first version string is less than, equal to or greater than second one.</p> <pre><code>if {[info exists ModuleTool] &amp;&amp; $ModuleTool eq {Modules} &amp;&amp; [versioncmp $ModuleToolVersion 4.7] &gt;= 0} { # here some code specific for Modules 4.7 and later versions } </code></pre> <p>The <code>ModuleTool</code> and <code>ModuleToolVersion</code> variables and the <code>versioncmp</code> modulefile command are supported by the <a href="https://github.com/TACC/Lmod/?utm_source=noticeable&amp;utm_campaign=cbzeg7wtvaiqj21zbumx.determining-module-implementation-and-version&amp;utm_content=publication+link&amp;utm_id=cbzeG7wTvAIqj21zbUmx.UPOFxJbXsysxyt1L7iHB.caQ04KEApvo5WpZsPwkV&amp;utm_medium=newspage" target="_blank" rel="noopener">Lmod</a> project starting version <code>8.4.8</code>.</p> Xavier Delaruelle[email protected]