diff --git a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2022b.yml b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2022b.yml new file mode 100644 index 0000000000..fddc86afc7 --- /dev/null +++ b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2022b.yml @@ -0,0 +1,2 @@ +easyconfigs: + - buildenv-default-foss-2022b.eb diff --git a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2023a.yml b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2023a.yml new file mode 100644 index 0000000000..d1ab03c094 --- /dev/null +++ b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2023a.yml @@ -0,0 +1,2 @@ +easyconfigs: + - buildenv-default-foss-2023a.eb diff --git a/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2023b.yml b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2023b.yml new file mode 100644 index 0000000000..58b079ab6b --- /dev/null +++ b/easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2023b.yml @@ -0,0 +1,2 @@ +easyconfigs: + - buildenv-default-foss-2023b.eb diff --git a/eb_hooks.py b/eb_hooks.py index 211e24c9d0..244687cd3f 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -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, @@ -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 @@ -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') @@ -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