Skip to content

Commit 4bfd2cc

Browse files
committed
Merge branch 'hook_for_unsupported_modules' of github.com:bedroge/software-layer-scripts into hook_for_unsupported_modules
2 parents 7b8a935 + 2dd23ff commit 4bfd2cc

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

eb_hooks.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,19 +1024,44 @@ def pre_configure_hook_wrf_aarch64(self, *args, **kwargs):
10241024
raise EasyBuildError("WRF-specific hook triggered for non-WRF easyconfig?!")
10251025

10261026

1027-
def pre_configure_hook_LAMMPS_zen4(self, *args, **kwargs):
1027+
def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs):
10281028
"""
10291029
pre-configure hook for LAMMPS:
1030-
- set kokkos_arch on x86_64/amd/zen4
1030+
- set kokkos_arch on x86_64/amd/zen4 and aarch64/nvidia/grace
1031+
- Disable SIMD for Aarch64 + cuda builds
10311032
"""
10321033

1034+
# Get cpu_target for zen4 hook
10331035
cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR')
1036+
10341037
if self.name == 'LAMMPS':
1038+
# Set kokkos_arch for LAMMPS version which do not have support for the target architecture
1039+
# This is no longer required with easybuild 5.1.2
10351040
if self.version in ('2Aug2023_update2', '2Aug2023_update4', '29Aug2024'):
10361041
if get_cpu_architecture() == X86_64:
10371042
if cpu_target == CPU_TARGET_ZEN4:
10381043
# There is no support for ZEN4 in LAMMPS yet so falling back to ZEN3
10391044
self.cfg['kokkos_arch'] = 'ZEN3'
1045+
elif get_cpu_architecture() == AARCH64:
1046+
if cpu_target == CPU_TARGET_NVIDIA_GRACE:
1047+
# There is no support for NVIDA grace in LAMMPS yet so falling back to ARMV81
1048+
self.cfg['kokkos_arch'] = 'ARMV81'
1049+
1050+
# Disable SIMD for specific CUDA versions
1051+
if self.version == '2Aug2023_update2':
1052+
if get_cpu_architecture() == AARCH64:
1053+
if self.cuda:
1054+
for dep in self.cfg.dependencies():
1055+
if 'CUDA' == dep['name']:
1056+
# This was broken until CUDA 13.1
1057+
if dep['version'] < LooseVersion('13.1'):
1058+
self.cfg['kokkos_arch'] = 'ARMV70'
1059+
cxxflags = os.getenv('CXXFLAGS', '')
1060+
cxxflags = cxxflags.replace('-mcpu=native', '')
1061+
cxxflags += ' -march=armv8-a+nosimd'
1062+
self.log.info("Setting CXXFLAGS to disable NEON: %s", cxxflags)
1063+
env.setvar('CXXFLAGS', cxxflags)
1064+
10401065
else:
10411066
raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!")
10421067

@@ -1596,7 +1621,7 @@ def post_easyblock_hook(self, *args, **kwargs):
15961621
'PMIx': pre_configure_hook_pmix_ipv6,
15971622
'PRRTE': pre_configure_hook_prrte_ipv6,
15981623
'WRF': pre_configure_hook_wrf_aarch64,
1599-
'LAMMPS': pre_configure_hook_LAMMPS_zen4,
1624+
'LAMMPS': pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda,
16001625
'Score-P': pre_configure_hook_score_p,
16011626
'VSEARCH': pre_configure_hook_vsearch,
16021627
'CMake': pre_configure_hook_cmake_system,

0 commit comments

Comments
 (0)