Skip to content

Commit

Permalink
Merge pull request EESSI#589 from Neves-P/espresso-lmodwarn
Browse files Browse the repository at this point in the history
Use `LmodMessage` instead of `LmodWarning` on loading ESPResSo v4.2.1
  • Loading branch information
bedroge authored May 31, 2024
2 parents e8cb651 + 76babe8 commit 87dfcbd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions create_lmodsitepackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,23 +175,25 @@
end
end
local function eessi_espresso_deprecated_warning(t)
local function eessi_espresso_deprecated_message(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
-- Print a message on loading ESPreSso v <= 4.2.1 recommending using v 4.2.2 and above.
-- A message and not a warning as the exit code would break CI runs otherwise.
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)
LmodMessage("\\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)
eessi_espresso_deprecated_message(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 87dfcbd

Please sign in to comment.