Skip to content

Commit 2dd23ff

Browse files
authored
Merge branch 'main' into hook_for_unsupported_modules
2 parents f6bb069 + 39fe1a4 commit 2dd23ff

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
@@ -1022,19 +1022,44 @@ def pre_configure_hook_wrf_aarch64(self, *args, **kwargs):
10221022
raise EasyBuildError("WRF-specific hook triggered for non-WRF easyconfig?!")
10231023

10241024

1025-
def pre_configure_hook_LAMMPS_zen4(self, *args, **kwargs):
1025+
def pre_configure_hook_LAMMPS_zen4_and_aarch64_cuda(self, *args, **kwargs):
10261026
"""
10271027
pre-configure hook for LAMMPS:
1028-
- set kokkos_arch on x86_64/amd/zen4
1028+
- set kokkos_arch on x86_64/amd/zen4 and aarch64/nvidia/grace
1029+
- Disable SIMD for Aarch64 + cuda builds
10291030
"""
10301031

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

@@ -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)