Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
easyconfigs:
- buildenv-default-foss-2022b.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
easyconfigs:
- buildenv-default-foss-2023a.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
easyconfigs:
- buildenv-default-foss-2023b.eb
31 changes: 30 additions & 1 deletion eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,16 @@ def pre_fetch_hook_zen4_gcccore1220(self, *args, **kwargs):
print_msg("Updated build option 'force' to 'True'")


def pre_module_hook_zen4_gcccore1220(self, *args, **kwargs):
"""Make module load-able during module step"""
if is_gcccore_1220_based(ecname=self.name, ecversion=self.version, tcname=self.toolchain.name,
tcversion=self.toolchain.version):
if hasattr(self, 'initial_environ'):
# Allow the module to be loaded in the module step (which uses initial environment)
print_msg(f"Setting {EESSI_IGNORE_ZEN4_GCC1220_ENVVAR} in initial environment")
self.initial_environ[EESSI_IGNORE_ZEN4_GCC1220_ENVVAR] = "1"


def post_module_hook_zen4_gcccore1220(self, *args, **kwargs):
"""Revert changes from pre_fetch_hook_zen4_gcccore1220"""
if is_gcccore_1220_based(ecname=self.name, ecversion=self.version, tcname=self.toolchain.name,
Expand All @@ -462,6 +472,12 @@ def post_module_hook_zen4_gcccore1220(self, *args, **kwargs):
raise EasyBuildError("Cannot restore force to it's original value: 'self' is misisng attribute %s.",
EESSI_FORCE_ATTR)

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


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


def pre_module_hook(self, *args, **kwargs):
"""Main pre module hook: trigger custom functions based on software name."""
if self.name in PRE_MODULE_HOOKS:
PRE_MODULE_HOOKS[self.name](self, *args, **kwargs)

# Always trigger this one, regardless of self.name
cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR')
if cpu_target == CPU_TARGET_ZEN4:
pre_module_hook_zen4_gcccore1220(self, *args, **kwargs)


def post_module_hook(self, *args, **kwargs):
"""Main post module hook: trigger custom functions based on software name."""
if self.name in POST_MODULE_HOOKS:
POST_MODULE_HOOKS[ec.name](self, *args, **kwargs)
POST_MODULE_HOOKS[self.name](self, *args, **kwargs)

# Always trigger this one, regardless of self.name
cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR')
Expand Down Expand Up @@ -1258,6 +1285,8 @@ def post_module_hook(self, *args, **kwargs):
'cuDNN': post_postproc_cudnn,
}

PRE_MODULE_HOOKS = {}

POST_MODULE_HOOKS = {}

# Define parallelism limit operations
Expand Down