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)... Details- 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)... Details- 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 <kenneth.hoste@ugent.be>
Co-authored-by: Kenneth Hoste <kenneth.hoste@ugent.be>
Co-authored-by: Kenneth Hoste <kenneth.hoste@ugent.be>
Co-authored-by: Kenneth Hoste <kenneth.hoste@ugent.be>
|
@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)... Details- 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) |
|
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
optarchis 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_GENERICfor 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_GENERICfor Arm as well, LAMMPS would automatically setKOKKOS_ARCH_ARM_NEON=OFF, which will disable Neon include statements. By using the existingARMV80target (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_64andriscv64so far (and will upload test reports), but I'll try to do some additional tests builds on at least Arm as well.