Skip to content

Commit

Permalink
workaround for LMOD to register two hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed Apr 6, 2024
1 parent d239c9f commit 822be66
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions create_lmodrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
return content
end
local function cuda_enabled_load_hook(t)
local function eessi_cuda_enabled_load_hook(t)
local frameStk = require("FrameStk"):singleton()
local mt = frameStk:mt()
local simpleName = string.match(t.modFullName, "(.-)/")
Expand Down Expand Up @@ -94,7 +94,7 @@
end
end
local function openmpi_load_hook(t)
local function eessi_openmpi_load_hook(t)
-- disable smcuda BTL when loading OpenMPI module for aarch64/neoverse_v1,
-- to work around hang/crash due to bug in OpenMPI;
-- see https://gitlab.com/eessi/support/-/issues/41
Expand All @@ -114,8 +114,15 @@
end
end
hook.register("load", cuda_enabled_load_hook)
hook.register("load", openmpi_load_hook)
-- 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_cuda_enabled_load_hook(t)
eessi_openmpi_load_hook(t)
end
hook.register("load", eessi_load_hook)
"""

def error(msg):
Expand Down

0 comments on commit 822be66

Please sign in to comment.