-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
disable CPU-specific optimizations for generic builds (by using a custom processor_arch
) in LAMMPS easyblock
#3484
Conversation
Test report by @bedroge Overview of tested easyconfigs (in order)
Build succeeded for 1 out of 1 (1 easyconfigs in total) Edit: this was done with |
processor_arch
) in LAMMPS easyblockprocessor_arch
) in LAMMPS easyblock
@boegelbot please test @ jsc-zen3 |
@bedroge: Request for testing this PR well received on jsczen3l1.int.jsc-zen3.fz-juelich.de PR test command '
Test results coming soon (I hope)... - notification for comment with ID 2411513509 processed Message to humans: this is just bookkeeping information for me, |
Test report by @bedroge Overview of tested easyconfigs (in order)
Build succeeded for 1 out of 1 (1 easyconfigs in total) Edit: this was also done with |
Test report by @boegelbot Overview of tested easyconfigs (in order)
Build succeeded for 10 out of 10 (5 easyconfigs in total) |
@boegelbot please test @ jsc-zen3 |
@bedroge: Request for testing this PR well received on jsczen3l1.int.jsc-zen3.fz-juelich.de PR test command '
Test results coming soon (I hope)... - notification for comment with ID 2411839250 processed Message to humans: this is just bookkeeping information for me, |
Test report by @boegelbot Overview of tested easyconfigs (in order)
Build succeeded for 10 out of 10 (5 easyconfigs in total) |
Co-authored-by: Kenneth Hoste <[email protected]>
Co-authored-by: Kenneth Hoste <[email protected]>
Co-authored-by: Kenneth Hoste <[email protected]>
Co-authored-by: Kenneth Hoste <[email protected]>
@boegelbot please test @ jsc-zen3 |
@bedroge: Request for testing this PR well received on jsczen3l1.int.jsc-zen3.fz-juelich.de PR test command '
Test results coming soon (I hope)... - notification for comment with ID 2421792355 processed Message to humans: this is just bookkeeping information for me, |
Test report by @boegelbot Overview of tested easyconfigs (in order)
Build succeeded for 10 out of 10 (5 easyconfigs in total) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Test report by @boegel Overview of tested easyconfigs (in order)
Build succeeded for 1 out of 1 (1 easyconfigs in total) |
LAMMPS uses archspec to determine the CPU type and it will enable optimizations for this CPU accordingly, even if
optarch
is set toGENERIC
. See for instance this EESSI issue which demonstrates/explains it in some more detail:EESSI/software-layer#545
This PR tries to solve that by overriding the CPU mapping for generic builds and using a custom CPU target
EASYBUILD_GENERIC
for these builds. By using a non-existent CPU type, all CPU-specific optimizations in theseIF(KOKKOS_ARCH_*)
statements in https://github.com/lammps/lammps/blob/stable_29Aug2024/lib/kokkos/cmake/kokkos_arch.cmake will be skipped, and hence no compiler optimization should be enabled. By default, they're all disabled. Furthermore, the compiler flags set by Easybuild, including the optimization flags for generic builds defined at https://github.com/easybuilders/easybuild-framework/blob/develop/easybuild/toolchains/compiler/gcc.py#L101, should be forwarded to the build step, which should result in properly built generic binaries.I had to make one exception here for Arm, since Neon seems to be (sort of?) required for armv8-a, see https://developer.arm.com/documentation/ka005463/latest/. If we would use
EASYBUILD_GENERIC
for Arm as well, LAMMPS would automatically setKOKKOS_ARCH_ARM_NEON=OFF
, which will disable Neon include statements. By using the existingARMV80
target (which is basically a generic Arm build anyway), this feature is enabled, see https://github.com/lammps/lammps/blob/stable_29Aug2024/lib/kokkos/cmake/kokkos_arch.cmake#L246.Note: I have only tested this with the latest LAMMPS version on
x86_64
andriscv64
so far (and will upload test reports), but I'll try to do some additional tests builds on at least Arm as well.