Skip to content

Commit 4b74510

Browse files
committed
gather all hooks about GPU modules in the parse hook
1 parent 83cbebc commit 4b74510

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/build_tools/hooks_hydra.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -360,16 +360,22 @@ def parse_hook(ec, *args, **kwargs): # pylint: disable=unused-argument
360360
ec.toolchain.options['optarch'] = optarchs_intel[LOCAL_ARCH]
361361
ec.log.info(f"[parse hook] Set optarch in parameter toolchainopts: {ec.toolchain.options['optarch']}")
362362

363-
# skip installation of CUDA software in non-GPU architectures, only create module file
363+
###############################
364+
# ------ GPU MODULES -------- #
365+
###############################
366+
367+
# skip installation of CUDA software in non-GPU architectures, only create a dummy module file
364368
if is_gpu_software(ec) and LOCAL_ARCH_FULL not in GPU_ARCHS:
365-
# only install the module file in non-GPU nodes
369+
ec.log.info("[parse hook] Generating dummy GPU module on non-GPU node")
370+
# remove all dependencies to avoid unnecessary module loads on the dummy module
371+
ec['dependencies'] = []
372+
# inject error message in module file
373+
ec['modluafooter'] = GPU_DUMMY_MOD_FOOTER
366374
# module_only steps: [MODULE_STEP, PREPARE_STEP, READY_STEP, POSTITER_STEP, SANITYCHECK_STEP]
367375
ec['module_only'] = True
368376
ec.log.info(f"[parse hook] Set parameter module_only: {ec['module_only']}")
369377
ec['skipsteps'] = [SANITYCHECK_STEP]
370378
ec.log.info(f"[parse hook] Set parameter skipsteps: {ec['skipsteps']}")
371-
# remove all dependencies to avoid unnecessary module loads on the dummy module
372-
ec['dependencies'] = []
373379

374380
# set cuda compute capabilities
375381
elif is_gpu_software(ec):
@@ -606,14 +612,6 @@ def pre_module_hook(self, *args, **kwargs): # pylint: disable=unused-argument
606612
else:
607613
self.cfg['docurls'] = [usage_info['link']]
608614

609-
#################################
610-
# ------ DUMMY MODULES -------- #
611-
#################################
612-
613-
if is_gpu_software(self.cfg) and LOCAL_ARCH_FULL not in GPU_ARCHS:
614-
self.log.info("[pre-module hook] Creating dummy module for CUDA modules on non-GPU nodes")
615-
self.cfg['modluafooter'] = GPU_DUMMY_MOD_FOOTER
616-
617615

618616
def post_build_and_install_loop_hook(ecs_with_res):
619617
"""

0 commit comments

Comments
 (0)