Skip to content

Commit

Permalink
Merge pull request #560 from Neves-P/espresso-lmodwarn
Browse files Browse the repository at this point in the history
Show Lmod warning when ESPResSo v4.2.1 is loaded
  • Loading branch information
ocaisa authored May 28, 2024
2 parents 1ac2c30 + 39c8aba commit 7ec100e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions create_lmodsitepackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,23 @@
end
end
local function eessi_espresso_deprecated_warning(t)
local frameStk = require("FrameStk"):singleton()
local mt = frameStk:mt()
local simpleName = string.match(t.modFullName, "(.-)/")
local version = string.match(t.modFullName, "%d.%d.%d")
if simpleName == 'ESPResSo' and version == '4.2.1' then
local advice = 'Prefer versions >= 4.2.2 which include important bugfixes.\\n'
advice = advice .. 'For details see https://github.com/espressomd/espresso/releases/tag/4.2.2\\n'
advice = advice .. 'Use version 4.2.1 at your own risk!\\n'
LmodWarning("\\nESPResSo v4.2.1 has known issues and has been deprecated. ", advice)
end
end
-- Combine both functions into a single one, as we can only register one function as load hook in lmod
-- Also: make it non-local, so it can be imported and extended by other lmodrc files if needed
function eessi_load_hook(t)
eessi_espresso_deprecated_warning(t)
-- Only apply CUDA hooks if the loaded module is in the EESSI prefix
-- This avoids getting an Lmod Error when trying to load a CUDA module from a local software stack
if from_eessi_prefix(t) then
Expand Down

0 comments on commit 7ec100e

Please sign in to comment.