Skip to content

Commit 5ad69ca

Browse files
committed
Merge branch 'LAMMPS_hook' into test_LAMMPS_HOOK
2 parents f10c5ad + 9bd9e9a commit 5ad69ca

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

eb_hooks.py

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ def pre_configure_hook_wrf_aarch64(self, *args, **kwargs):
10061006
def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs):
10071007
"""
10081008
pre-configure hook for LAMMPS:
1009-
- set kokkos_arch on x86_64/amd/zen4
1009+
- set kokkos_arch on x86_64/amd/zen4 and aarch64/nvidia/grace
10101010
- Disable SIMD for Aarch64 + cuda builds
10111011
"""
10121012

@@ -1019,34 +1019,36 @@ def pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda(self, *args, **kwargs):
10191019

10201020
if self.name == 'LAMMPS':
10211021

1022-
# Set kokkos_arch for LAMMPS version which do not have support for versions that do not support ZEN4
1023-
if self.version in ('2Aug2023_update2', '2Aug2023_update4', '29Aug2024'):
1024-
if get_cpu_architecture() == X86_64:
1025-
if cpu_target == CPU_TARGET_ZEN4:
1026-
# There is no support for ZEN4 in LAMMPS yet so falling back to ZEN3
1027-
self.cfg['kokkos_arch'] = 'ZEN3'
1028-
elif cpu_target == CPU_TARGET_NVIDIA_GRACE:
1029-
# There is no support for NVIDA grace in LAMMPS yet so falling back to ARMV81
1030-
self.cfg['kokkos_arch'] 'ARMV81'
1031-
1032-
# Disable SIMD for specific CUDA versions
1033-
if self.version == '2Aug2023_update2':
1034-
if get_cpu_architecture() == AARCH64:
1035-
if ('CUDA' in [dep['name'] for dep in deps]):
1036-
for dep in deps:
1037-
if 'CUDA' == dep['name']:
1038-
if dep['version'] in cuda_versions:
1039-
cxxflags = os.getenv('CXXFLAGS', '')
1040-
cxxflags = cxxflags.replace('-mcpu=native', '')
1041-
# All ARM targets of 2Aug2023_update are build with ARMV80 or ARM81.
1042-
# This is not the case for newer versions.
1043-
cxxflags += ' -march=armv8-a+nosimd'
1044-
self.log.info("Setting CXXFLAGS to disable NEON: %s", cxxflags)
1045-
env.setvar('CXXFLAGS', cxxflags)
1022+
# Set kokkos_arch for LAMMPS version which do not have support for versions that do not support ZEN4
1023+
if self.version in ('2Aug2023_update2', '2Aug2023_update4', '29Aug2024'):
1024+
if get_cpu_architecture() == X86_64:
1025+
if cpu_target == CPU_TARGET_ZEN4:
1026+
# There is no support for ZEN4 in LAMMPS yet so falling back to ZEN3
1027+
self.cfg['kokkos_arch'] = 'ZEN3'
1028+
elif get_cpu_architecture() == AARCH64:
1029+
if cpu_target == CPU_TARGET_NVIDIA_GRACE:
1030+
# There is no support for NVIDA grace in LAMMPS yet so falling back to ARMV81
1031+
self.cfg['kokkos_arch'] = 'ARMV81'
1032+
1033+
# Disable SIMD for specific CUDA versions
1034+
if self.version == '2Aug2023_update2':
1035+
if get_cpu_architecture() == AARCH64:
1036+
if ('CUDA' in [dep['name'] for dep in deps]):
1037+
for dep in deps:
1038+
if 'CUDA' == dep['name']:
1039+
if dep['version'] in cuda_versions:
1040+
cxxflags = os.getenv('CXXFLAGS', '')
1041+
cxxflags = cxxflags.replace('-mcpu=native', '')
1042+
# All ARM targets of 2Aug2023_update are build with ARMV80 or ARM81.
1043+
# This is not the case for newer versions.
1044+
cxxflags += ' -march=armv8-a+nosimd'
1045+
self.log.info("Setting CXXFLAGS to disable NEON: %s", cxxflags)
1046+
env.setvar('CXXFLAGS', cxxflags)
10461047

10471048
else:
10481049
raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!")
10491050

1051+
10501052
def pre_configure_hook_cmake_system(self, *args, **kwargs):
10511053
"""
10521054
pre-configure hook for CMake built with SYSTEM toolchain:

0 commit comments

Comments
 (0)