@@ -33,12 +33,17 @@ This Lua modulefile requires a corresponding Tcl version for Environment
3333Modules to interpret it. Below are the commands to use when creating the
3434equivalent Tcl modulefile to ensure the same functionality:
3535
36- * ``report `` procedure is equivalent to ``LmodMessage ``
36+ * ``report `` procedure is equivalent to ``LmodMessage `` (execution should be
37+ restricted to ``load `` evaluation mode to avoid polluting other modes)
3738* ``error `` command is equivalent to ``LmodError ``
3839* ``module-help `` (v5.6+) is equivalent to ``help `` (if version below 5.6 is
3940 expected, define a ``ModulesHelp `` procedure)
4041* ``module-tag `` command is equivalent to ``add_property `` (needed to define
4142 the ``sticky `` tag)
43+ * ``uname machine `` modulefile command is equivalent than calling ``uname -m ``
44+ in a sub-process
45+ * ``versioncmp `` command helps to compare software release number (like
46+ ``convertToCanonical `` does in Lua)
4247
4348.. _EESSI bash script :
4449
@@ -123,6 +128,31 @@ set.
123128This script is similar to `EESSI Lmod initialization shell scripts `_ described
124129above and the same adaptation strategy could be applied here.
125130
131+ .. _EESSI-extend Lua module :
132+
133+ ``EESSI-extend-easybuild.eb `` easyconfig file
134+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
135+
136+ This easyconfig file is there to produce the extra modulefile
137+ ``EESSI-extend ``. It contains a large ``modluafooter `` variable to define the
138+ content of the modulefile.
139+
140+ A Tcl version of this ``EESSI-extend `` modulefile is needed for Environment
141+ Modules. A ``modtclfooter `` variable should be added in the easyconfig file to
142+ define the same kind of code than in ``modluafooter ``.
143+
144+ The following Tcl code, similar to the one needed for the `EESSI Lua module `_,
145+ is needed here to provide the same functionalities than the Lua code:
146+
147+ * ``report `` procedure is equivalent to ``LmodMessage `` (execution should be
148+ restricted to ``load `` evaluation mode to avoid polluting other modes)
149+ * ``error `` command is equivalent to ``LmodError ``
150+ * ``versioncmp `` command helps to compare software release number (like
151+ ``convertToCanonical `` does in Lua)
152+ * ``module load `` command should be used to translate the if not
153+ ``isloaded() `` then ``load() `` code block (in order to always define the
154+ dependency link, even if it is already loaded)
155+
126156``$EESSI_SOFTWARE_PATH/modules `` modulepaths
127157^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128158
@@ -189,6 +219,58 @@ the EESSI repository and each Environment Modules installation should point to
189219it via a symbolic link. No ``LMOD_PACKAGE_PATH `` environment variable should
190220be ported to Environment Modules.
191221
222+ Site-specific ``SitePackage.lua `` config file
223+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
224+
225+ As expressed in `EESSI issue #456 `_, site-specific ``SitePackage.lua `` config
226+ file may be used to apply tuning when loading specific modules. Here it meant
227+ adding environment variable definition into the modulefile evaluation context.
228+
229+ .. _EESSI issue #456 : https://github.com/EESSI/software-layer/issues/456
230+
231+ The software provided by EESSI have a generic configuration that may need to
232+ be adapted to correctly work on sites, especially things related to the
233+ underlying high performance network of the supercomputer.
234+
235+ The recommended way to provide an equivalent functionality is to let site
236+ define the content of a modulefile where they will put all their configuration
237+ specificities. This modulefile would be automatically loaded by the ``EESSI ``
238+ modulefile.
239+
240+ With this approach, sites only have to maintain environment definition and not
241+ complex hook code in addition to environment definition code. The counterpart
242+ is that these environment changes are loaded once and for all even if the
243+ modules they relate to are not loaded.
244+
245+ If the strategy to use a site-specific modulefile for this setup does not fit,
246+ a site-specific ``siteconfig.tcl `` file can be used with the following kind of
247+ code:
248+
249+ .. code-block :: tcl
250+
251+ proc load_hook {cmd_str op} {
252+ switch -- [module-info name] {
253+ OpenMPI/5.0.3 {
254+ set itrp [getCurrentModfileInterpName]
255+ interp eval $itrp {
256+ setenv OMPI_MCA_btl ^openib
257+ setenv OMPI_MCA_osc ^ucx
258+ setenv OMPI_MCA_pml ^ucx
259+ }
260+ }
261+ }
262+ }
263+ trace add execution evaluateModulefile enter load_hook
264+
265+ Such site-specific ``siteconfig.tcl `` file may be loaded by the main
266+ ``siteconfig.tcl `` section as described in the above section.
267+
268+ Adding Environment Modules into EESSI compat layer
269+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
270+
271+ A Gentoo Ebuild should be developed for Environment Modules to incorporate it
272+ into the EESSI compatibility layer.
273+
192274Branching depending on chosen module tool
193275-----------------------------------------
194276
@@ -246,13 +328,48 @@ of ``EESSI`` modulefile.
246328Based on the analysis of `EESSI Lua module `_, the following things should be
247329taken into account:
248330
249- * ``report `` procedure should be added to Lmod to support an equivalent to
331+ * ``report `` procedure should be added to Lmod to support an equivalent of
250332 ``LmodMessage `` in Tcl evaluation context
251333* ``module-help `` is available on Lmod (in the not yet released version after
252334 8.7.65): if EESSI would like to support older Lmod releases, the
253335 ``ModulesHelp `` procedure should be used instead
254336* ``add-property `` should be used instead of ``module-tag `` to define the
255337 module ``sticky ``: Environment Modules 5.6+ supports defining a tag with
256338 this command
339+ * ``uname machine `` modulefile command is supported by Lmod
340+ * ``versioncmp `` modulefile command is supported by Lmod since 8.4.7
341+
342+ ``EESSI-extend/2025.06-easybuild `` modulefile only in Tcl syntax
343+ ----------------------------------------------------------------
344+
345+ Like for the ``EESSI `` module, having only a Tcl modulefile for the
346+ ``EESSI-extend `` will help to reduce the overall quantity of code to maintain.
347+
348+ Based on the analysis of `EESSI-extend Lua module `_, the following things
349+ should be taken into account to have a Tcl version of ``EESSI-extend `` module
350+ that Lmod is able to evaluate:
351+
352+ * ``report `` procedure should be added to Lmod to support an equivalent of
353+ ``LmodMessage `` in Tcl evaluation context
354+ * ``module-help `` is available on Lmod (in the not yet released version after
355+ 8.7.65): if EESSI would like to support older Lmod releases, the
356+ ``ModulesHelp `` procedure should be used instead
357+ * ``versioncmp `` modulefile command is supported by Lmod since 8.4.7
358+ * ``depends-on `` should be used instead of ``module load `` to define
359+ ``EasyBuild `` module dependency (to avoid reload of the module by Lmod if it
360+ is already loaded)
361+
362+ Decommissioning the EESSI ``bash `` initialization script
363+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
364+
365+ EESSI currently provides two ways for initialization which adds load to the
366+ maintenance process. Advertising a single initialization way may simplify
367+ things.
368+
369+ Initialization via the ``EESSI `` modulefile allows to switch between EESSI
370+ releases.
371+
372+ For a smooth migration, the ``bash `` initialization script may at first
373+ redirect to the ``EESSI `` modulefile initialization process.
257374
258375.. vim:set tabstop=2 shiftwidth=2 expandtab autoindent:
0 commit comments