Skip to content

Commit 38a74b9

Browse files
committed
add Lmod hook that prints warning for SciPy-bundle on Grace/Hopper
1 parent a96d759 commit 38a74b9

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

create_lmodsitepackage.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,31 @@
199199
end
200200
end
201201
202+
local function eessi_scipy_2022b_test_failures_message(t)
203+
local cpuArch = os.getenv("EESSI_SOFTWARE_SUBDIR")
204+
local graceArch = 'aarch64/nvidia/grace'
205+
local fullModuleName = 'SciPy-bundle/2023.02-gfbf-2022b'
206+
local moduleVersionArchMatch = t.modFullName == fullModuleName and cpuArch == graceArch
207+
if moduleVersionArchMatch and not os.getenv("EESSI_IGNORE_MODULE_WARNINGS") then
208+
-- Print a message on loading SciPy-bundle version == 2023.02 informing about the higher number of
209+
-- test failures and recommend using other versions available via EESSI.
210+
-- A message and not a warning as the exit code would break CI runs otherwise.
211+
local simpleName = string.match(t.modFullName, "(.-)/")
212+
local advice = 'The module ' .. t.modFullName .. ' will be loaded. However, note that\n'
213+
advice = advice .. 'during its building for the CPU microarchitecture ' .. graceArch .. ' from a\n'
214+
advice = advice .. 'total of 52.730 unit tests a larger number (46) than usually (2-4) failed. If\n'
215+
advice = advice .. 'you encounter issues while using ' .. t.modFullName .. ', please,\n'
216+
advice = advice .. 'consider using one of the other versions of ' .. simpleName .. ' that are also provided\n'
217+
advice = advice .. 'for the same CPU microarchitecture.\n'
218+
LmodMessage("\n", advice)
219+
end
220+
end
221+
202222
-- Combine both functions into a single one, as we can only register one function as load hook in lmod
203223
-- Also: make it non-local, so it can be imported and extended by other lmodrc files if needed
204224
function eessi_load_hook(t)
205225
eessi_espresso_deprecated_message(t)
226+
eessi_scipy_2022b_test_failures_message(t)
206227
-- Only apply CUDA and cu*-library hooks if the loaded module is in the EESSI prefix
207228
-- This avoids getting an Lmod Error when trying to load a CUDA or cu* module from a local software stack
208229
if from_eessi_prefix(t) then

0 commit comments

Comments
 (0)