From f596b1e70d3c3bdd1bdfcab37a9b514712a77839 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 27 May 2025 14:32:37 +0200 Subject: [PATCH 1/5] {2023.06}[2022b,2023a,2023b] buildenv default --- .../software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2022b.yml | 2 ++ .../software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2023a.yml | 2 ++ .../software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2023b.yml | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2022b.yml create mode 100644 easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2023a.yml create mode 100644 easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-5.1.0-2023b.yml 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 From 66880445296c77a15bce50522e3cce902eceeb7f Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 27 May 2025 16:22:01 +0200 Subject: [PATCH 2/5] Tweak eb_hooks for module-only on Zen4 --- eb_hooks.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/eb_hooks.py b/eb_hooks.py index 211e24c9d0..c019638f8f 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -444,6 +444,15 @@ 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): + """Revert changes from pre_fetch_hook_zen4_gcccore1220""" + if is_gcccore_1220_based(ecname=self.name, ecversion=self.version, tcname=self.toolchain.name, + tcversion=self.toolchain.version): + if hasattr(self, EESSI_MODULE_ONLY_ATTR): + # Allow the module to be loaded in the module step + os.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 +471,10 @@ 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 os.environ.get(EESSI_IGNORE_ZEN4_GCC1220_ENVVAR, False): + del os.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 +1199,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 POST_MODULE_HOOKS: + POST_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 +1282,8 @@ def post_module_hook(self, *args, **kwargs): 'cuDNN': post_postproc_cudnn, } +PRE_MODULE_HOOKS = {} + POST_MODULE_HOOKS = {} # Define parallelism limit operations From 49eb3a81ede4dbcd71d297034ce987af13a0931f Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 27 May 2025 16:24:34 +0200 Subject: [PATCH 3/5] Fix --- eb_hooks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index c019638f8f..5752daa038 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1201,8 +1201,8 @@ def inject_gpu_property(ec): def pre_module_hook(self, *args, **kwargs): """Main pre module hook: trigger custom functions based on software name.""" - if self.name in POST_MODULE_HOOKS: - POST_MODULE_HOOKS[self.name](self, *args, **kwargs) + 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') From 941ec9c46f6f7092efc20710a23452c88c93a383 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 27 May 2025 20:02:53 +0200 Subject: [PATCH 4/5] Module step uses initial environment so must tweak that --- eb_hooks.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 5752daa038..28463e053d 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -450,7 +450,8 @@ def pre_module_hook_zen4_gcccore1220(self, *args, **kwargs): tcversion=self.toolchain.version): if hasattr(self, EESSI_MODULE_ONLY_ATTR): # Allow the module to be loaded in the module step - os.environ[EESSI_IGNORE_ZEN4_GCC1220_ENVVAR] = "1" + 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): @@ -472,8 +473,9 @@ def post_module_hook_zen4_gcccore1220(self, *args, **kwargs): EESSI_FORCE_ATTR) # If the variable to allow loading is set, remove it - if os.environ.get(EESSI_IGNORE_ZEN4_GCC1220_ENVVAR, False): - del os.environ[EESSI_IGNORE_ZEN4_GCC1220_ENVVAR] + 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 From 0df35f4df9e9abc65d764d21224b0e92a9a416a4 Mon Sep 17 00:00:00 2001 From: Alan O'Cais Date: Tue, 27 May 2025 20:14:18 +0200 Subject: [PATCH 5/5] Be more careful about when initial environment is altered --- eb_hooks.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 28463e053d..244687cd3f 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -445,11 +445,11 @@ def pre_fetch_hook_zen4_gcccore1220(self, *args, **kwargs): def pre_module_hook_zen4_gcccore1220(self, *args, **kwargs): - """Revert changes from pre_fetch_hook_zen4_gcccore1220""" + """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, EESSI_MODULE_ONLY_ATTR): - # Allow the module to be loaded in the module step + 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" @@ -473,9 +473,10 @@ def post_module_hook_zen4_gcccore1220(self, *args, **kwargs): EESSI_FORCE_ATTR) # If the variable to allow loading is set, remove it - 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] + 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