Skip to content

Commit 982a305

Browse files
committed
Merge remote-tracking branch 'upstream/2023.06-software.eessi.io' into fix-cuddn-hook
2 parents 977d319 + 9a28547 commit 982a305

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
easyconfigs:
2+
- buildenv-default-foss-2022b.eb
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
easyconfigs:
2+
- buildenv-default-foss-2023a.eb
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
easyconfigs:
2+
- buildenv-default-foss-2023b.eb

eb_hooks.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,16 @@ def pre_fetch_hook_zen4_gcccore1220(self, *args, **kwargs):
444444
print_msg("Updated build option 'force' to 'True'")
445445

446446

447+
def pre_module_hook_zen4_gcccore1220(self, *args, **kwargs):
448+
"""Make module load-able during module step"""
449+
if is_gcccore_1220_based(ecname=self.name, ecversion=self.version, tcname=self.toolchain.name,
450+
tcversion=self.toolchain.version):
451+
if hasattr(self, 'initial_environ'):
452+
# Allow the module to be loaded in the module step (which uses initial environment)
453+
print_msg(f"Setting {EESSI_IGNORE_ZEN4_GCC1220_ENVVAR} in initial environment")
454+
self.initial_environ[EESSI_IGNORE_ZEN4_GCC1220_ENVVAR] = "1"
455+
456+
447457
def post_module_hook_zen4_gcccore1220(self, *args, **kwargs):
448458
"""Revert changes from pre_fetch_hook_zen4_gcccore1220"""
449459
if is_gcccore_1220_based(ecname=self.name, ecversion=self.version, tcname=self.toolchain.name,
@@ -462,6 +472,12 @@ def post_module_hook_zen4_gcccore1220(self, *args, **kwargs):
462472
raise EasyBuildError("Cannot restore force to it's original value: 'self' is misisng attribute %s.",
463473
EESSI_FORCE_ATTR)
464474

475+
# If the variable to allow loading is set, remove it
476+
if hasattr(self, 'initial_environ'):
477+
if self.initial_environ.get(EESSI_IGNORE_ZEN4_GCC1220_ENVVAR, False):
478+
print_msg(f"Removing {EESSI_IGNORE_ZEN4_GCC1220_ENVVAR} in initial environment")
479+
del self.initial_environ[EESSI_IGNORE_ZEN4_GCC1220_ENVVAR]
480+
465481

466482
# Modules for dependencies are loaded in the prepare step. Thus, that's where we need this variable to be set
467483
# so that the modules can be succesfully loaded without printing the error (so that we can create a module
@@ -1189,10 +1205,21 @@ def inject_gpu_property(ec):
11891205
return ec
11901206

11911207

1208+
def pre_module_hook(self, *args, **kwargs):
1209+
"""Main pre module hook: trigger custom functions based on software name."""
1210+
if self.name in PRE_MODULE_HOOKS:
1211+
PRE_MODULE_HOOKS[self.name](self, *args, **kwargs)
1212+
1213+
# Always trigger this one, regardless of self.name
1214+
cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR')
1215+
if cpu_target == CPU_TARGET_ZEN4:
1216+
pre_module_hook_zen4_gcccore1220(self, *args, **kwargs)
1217+
1218+
11921219
def post_module_hook(self, *args, **kwargs):
11931220
"""Main post module hook: trigger custom functions based on software name."""
11941221
if self.name in POST_MODULE_HOOKS:
1195-
POST_MODULE_HOOKS[ec.name](self, *args, **kwargs)
1222+
POST_MODULE_HOOKS[self.name](self, *args, **kwargs)
11961223

11971224
# Always trigger this one, regardless of self.name
11981225
cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR')
@@ -1261,6 +1288,8 @@ def post_module_hook(self, *args, **kwargs):
12611288
'cuDNN': post_postproc_cudnn,
12621289
}
12631290

1291+
PRE_MODULE_HOOKS = {}
1292+
12641293
POST_MODULE_HOOKS = {}
12651294

12661295
# Define parallelism limit operations

0 commit comments

Comments
 (0)