Skip to content

Cap the libxc build parallelism at 4 - #337

Merged
casparvl merged 9 commits into
EESSI:mainfrom
HaoZeke:libxc-parallelism-divide-by-3-v2
Nov 6, 2026
Merged

casparvl merged 9 commits into
EESSI:mainfrom
HaoZeke:libxc-parallelism-divide-by-3-v2

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Companion to EESSI/software-layer#1772.

The libxc 7.0.0 build for x86_64/amd/zen4 there was killed twice by the out-of-memory killer in cc1.
This caps the libxc build at 8 parallel jobs on every target, instead of dividing the core count by 3, so a large build node no longer starts more cc1 processes than its memory can hold.
The A64FX limit stays at 6.

AI disclosure: an AI coding assistant helped write this change.
I reviewed it and checked the builds and tests myself.

The libxc 7.0.0 build for x86_64/amd/zen4 in EESSI/software-layer#1772
was killed twice with the same OOM in cc1 at half the cores.
A divider of 3 gives 5 jobs on a 16-core build node instead of 8.
@casparvl

casparvl commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Testing this in EESSI/software-layer#1772 (comment)

@casparvl

casparvl commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Still went OOM - or so it seems. We can try to reduce parallelism even further. But by now I'm not convinced that it isn't the memory consumption of one of the threads that is a bottleneck...

The good news I guess is that the build time wasn't all that different. Maybe we should just really crank it, go for a reduction of 8 (i.e. 2 cores), see if that works. It'll take the least amount of human time to just try this.

@HaoZeke HaoZeke changed the title Divide the libxc build parallelism by 3 instead of 2 Cap the libxc build parallelism at 8 Nov 3, 2026
Comment thread eb_hooks.py Resolved
@casparvl casparvl changed the title Cap the libxc build parallelism at 8 Cap the libxc build parallelism at 2 Nov 4, 2026
Eleven libxc 7.0.0 translation units peaked at 2 GiB or more with GCC 15.2.0 at -O3.
The hook compiles those files at -O1 for libxc 7.0.0 and newer when the easyblock is CMakeMake.
Those builds use the normal job count.
Older libxc and ConfigureMake libxc keep the 2-core cap.
The A64FX limit of 6 cores is unchanged.
libxc 7.1.2 cc1 peaked at 2.153 GiB on lda_xc_ksdt.c with -O3.
The same translation unit peaked at 2.530 GiB with -O1, so -O1 is the wrong flag.
The eleven-file list is unchanged.
@HaoZeke

HaoZeke commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

The -O1 hook is about memory at high -j, not correctness.

On 8 cores, make -j 8 of libxc 7.0.0 peaked at 13.259 GiB and oom_kill stayed 0.
CTest passed 20556 of 20556 for the static build and again for the shared build.
The energy density matched between the -O1 library and the -O3 objects for all eleven functionals.
libxc 7.1.2 peaked at 5.693 GiB, and its three C tests passed in both iterations.
lda_xc_ksdt.c stays off the list because -O1 raised its cc1 peak from 2.153 GiB to 2.530 GiB.

@casparvl

casparvl commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Honestly, I wouldn't change the optimizations just because of a memory issue at compile time - this is a one time issue, we can wait longer (even if it is annoying). If that in the end gets us a better optimized binary, that's worth it. Also: a reduction in parallelism is a standard procedure, and thus easy to maintain - this solution would require more maintenance.

The annoying part is figuring out the exact limit for -j ;-) Should have probably just done an interactive build and looked at C-group limits to make a more educated guess, rather than trial and error, but I simply didn't have the time.

Anyway, with 2 it works. I'd like to double check if it also works at 4, since build times have now increased quite substantially (even though we saw little difference between -j 8 and -j 5). Can you revert the -O1 change and set parallelism to max 4 cores? I'll give that a try in EESSI/software-layer#1906 then, see if that still works. If it does, I'll build all the other targets as well.

@bedroge

bedroge commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Honestly, I wouldn't change the optimizations just because of a memory issue at compile time - this is a one time issue, we can wait longer (even if it is annoying). If that in the end gets us a better optimized binary, that's worth it. Also: a reduction in parallelism is a standard procedure, and thus easy to maintain - this solution would require more maintenance.

Completely agree with Caspar here, and, ultimately, we could even spin up some machines with more memory like we've done for the hipBLAS builds (though that's not possible for e.g. A64FX, RISC-V, Grace).

@casparvl casparvl changed the title Cap the libxc build parallelism at 2 Cap the libxc build parallelism at 4 Nov 5, 2026

@bedroge bedroge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build in EESSI/software-layer#1906 (comment) succeeded, so lgtm

@bedroge

bedroge commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

bot: build repo:eessi.io-2023.06-software instance:eessi-bot-deucalion for:arch=aarch64/a64fx
bot: build repo:eessi.io-2025.06-software instance:eessi-bot-deucalion for:arch=aarch64/a64fx
bot: build repo:eessi.io-2026.06-software instance:eessi-bot-deucalion for:arch=aarch64/a64fx

@eessi-bot-deucalion

eessi-bot-deucalion Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

New job on instance eessi-bot-deucalion for repository eessi.io-2023.06-software
Building on: a64fx
Building for: aarch64/a64fx
Job dir: /home/eessibot/new-bot/jobs/2026.11/pr_337/2201107

date job status comment
Nov 06 10:16:57 UTC 2026 submitted job id 2201107 awaits release by job manager
Nov 06 10:18:00 UTC 2026 released job awaits launch by Slurm scheduler
Nov 06 10:19:03 UTC 2026 running job 2201107 is running
Nov 06 10:28:48 UTC 2026 finished
😁 SUCCESS (click triangle for details)
Details
✅ job output file slurm-2201107.out
✅ no message matching FATAL:
✅ no message matching ERROR:
✅ no message matching FAILED:
✅ no message matching required modules missing:
✅ found message(s) matching No missing installations
✅ found message matching .tar.* created!
Artefacts
eessi-2023.06-software-linux-aarch64-a64fx-17939604420.tar.zstsize: 0 MiB (37975 bytes)
entries: 1
modules under 2023.06/software/linux/aarch64/a64fx/modules/all
no module files in tarball
software under 2023.06/software/linux/aarch64/a64fx/software
no software packages in tarball
reprod directories under 2023.06/software/linux/aarch64/a64fx/reprod
no reprod directories in tarball
other under 2023.06/software/linux/aarch64/a64fx
no other files in tarball
Nov 06 10:28:48 UTC 2026 test result
😁 SUCCESS (click triangle for details)
ReFrame Summary
[ SKIP ] ( 1/10) Skipping test: nodes in this partition only have 30720 MiB memory available (per node) according to the current ReFrame configuration, but 49152 MiB is needed
[ SKIP ] ( 2/10) Skipping test: nodes in this partition only have 30720 MiB memory available (per node) according to the current ReFrame configuration, but 49152 MiB is needed
[ SKIP ] ( 3/10) Skipping test: nodes in this partition only have 30720 MiB memory available (per node) according to the current ReFrame configuration, but 49152 MiB is needed
[ SKIP ] ( 4/10) Skipping test: nodes in this partition only have 30720 MiB memory available (per node) according to the current ReFrame configuration, but 49152 MiB is needed
[ OK ] ( 5/10) EESSI_LAMMPS_lj %device_type=cpu %module_info=('BotBuildTests:a64fx', 'default', 'LAMMPS/2Aug2023_update2-foss-2023a-kokkos') %scale=1_node /a7d4ddbc @BotBuildTests:a64fx+default
P: perf: 573.568 timesteps/s (r:0, l:None, u:None)
[ OK ] ( 6/10) EESSI_LAMMPS_lj %device_type=cpu %module_info=('BotBuildTests:a64fx', 'default', 'LAMMPS/29Aug2024-foss-2023b-kokkos') %scale=1_node /60400152 @BotBuildTests:a64fx+default
P: perf: 581.59 timesteps/s (r:0, l:None, u:None)
[ OK ] ( 7/10) EESSI_OSU_pt2pt_CPU %benchmark_info=mpi.pt2pt.osu_latency %module_info=('BotBuildTests:a64fx', 'default', 'OSU-Micro-Benchmarks/7.2-gompi-2023b') %scale=1_node /e1b5de1d @BotBuildTests:a64fx+default
P: latency: 1.21 us (r:0, l:None, u:None)
[ OK ] ( 8/10) EESSI_OSU_pt2pt_CPU %benchmark_info=mpi.pt2pt.osu_latency %module_info=('BotBuildTests:a64fx', 'default', 'OSU-Micro-Benchmarks/7.1-1-gompi-2023a') %scale=1_node /8b341075 @BotBuildTests:a64fx+default
P: latency: 1.2 us (r:0, l:None, u:None)
[ OK ] ( 9/10) EESSI_OSU_pt2pt_CPU %benchmark_info=mpi.pt2pt.osu_bw %module_info=('BotBuildTests:a64fx', 'default', 'OSU-Micro-Benchmarks/7.2-gompi-2023b') %scale=1_node /5d554c48 @BotBuildTests:a64fx+default
P: bandwidth: 8712.66 MB/s (r:0, l:None, u:None)
[ OK ] (10/10) EESSI_OSU_pt2pt_CPU %benchmark_info=mpi.pt2pt.osu_bw %module_info=('BotBuildTests:a64fx', 'default', 'OSU-Micro-Benchmarks/7.1-1-gompi-2023a') %scale=1_node /0d7a6936 @BotBuildTests:a64fx+default
P: bandwidth: 8713.2 MB/s (r:0, l:None, u:None)
[ PASSED ] Ran 6/10 test case(s) from 10 check(s) (0 failure(s), 4 skipped, 0 aborted)
Details
✅ job output file slurm-2201107.out
✅ no message matching ERROR:
✅ no message matching [\s*FAILED\s*].*Ran .* test case
Nov 06 10:29:43 UTC 2026 uploaded transfer of eessi-2023.06-software-linux-aarch64-a64fx-17939604420.tar.zst to S3 bucket succeeded

@eessi-bot-deucalion

eessi-bot-deucalion Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

New job on instance eessi-bot-deucalion for repository eessi.io-2025.06-software
Building on: a64fx
Building for: aarch64/a64fx
Job dir: /home/eessibot/new-bot/jobs/2026.11/pr_337/2201110

date job status comment
Nov 06 10:17:03 UTC 2026 submitted job id 2201110 awaits release by job manager
Nov 06 10:17:56 UTC 2026 released job awaits launch by Slurm scheduler
Nov 06 10:19:06 UTC 2026 running job 2201110 is running
Nov 06 10:26:43 UTC 2026 finished
😁 SUCCESS (click triangle for details)
Details
✅ job output file slurm-2201110.out
✅ no message matching FATAL:
✅ no message matching ERROR:
✅ no message matching FAILED:
✅ no message matching required modules missing:
✅ found message(s) matching No missing installations
✅ found message matching .tar.* created!
Artefacts
eessi-2025.06-software-linux-aarch64-a64fx-17939604400.tar.zstsize: 0 MiB (37979 bytes)
entries: 1
modules under 2025.06/software/linux/aarch64/a64fx/modules/all
no module files in tarball
software under 2025.06/software/linux/aarch64/a64fx/software
no software packages in tarball
reprod directories under 2025.06/software/linux/aarch64/a64fx/reprod
no reprod directories in tarball
other under 2025.06/software/linux/aarch64/a64fx
no other files in tarball
Nov 06 10:26:43 UTC 2026 test result
😢 FAILURE (click triangle for details)
Reason
EESSI test suite produced failures.
ReFrame Summary
[ FAILED ] Ran 6/6 test case(s) from 6 check(s) (6 failure(s), 0 skipped, 0 aborted)
Details
✅ job output file slurm-2201110.out
❌ found message matching ERROR:
❌ found message matching [\s*FAILED\s*].*Ran .* test case
Nov 06 10:29:24 UTC 2026 uploaded transfer of eessi-2025.06-software-linux-aarch64-a64fx-17939604400.tar.zst to S3 bucket succeeded

@eessi-bot-deucalion

eessi-bot-deucalion Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

New job on instance eessi-bot-deucalion for repository eessi.io-2026.06-software
Building on: a64fx
Building for: aarch64/a64fx
Job dir: /home/eessibot/new-bot/jobs/2026.11/pr_337/2201111

date job status comment
Nov 06 10:17:09 UTC 2026 submitted job id 2201111 awaits release by job manager
Nov 06 10:17:54 UTC 2026 released job awaits launch by Slurm scheduler
Nov 06 10:19:09 UTC 2026 running job 2201111 is running
Nov 06 10:24:36 UTC 2026 finished
😁 SUCCESS (click triangle for details)
Details
✅ job output file slurm-2201111.out
✅ no message matching FATAL:
✅ no message matching ERROR:
✅ no message matching FAILED:
✅ no message matching required modules missing:
✅ found message(s) matching No missing installations
✅ found message matching .tar.* created!
Artefacts
eessi-2026.06-software-linux-aarch64-a64fx-17939604490.tar.zstsize: 0 MiB (37935 bytes)
entries: 1
modules under 2026.06/software/linux/aarch64/a64fx/modules/all
no module files in tarball
software under 2026.06/software/linux/aarch64/a64fx/software
no software packages in tarball
reprod directories under 2026.06/software/linux/aarch64/a64fx/reprod
no reprod directories in tarball
other under 2026.06/software/linux/aarch64/a64fx
no other files in tarball
Nov 06 10:24:36 UTC 2026 test result
😢 FAILURE (click triangle for details)
Reason
EESSI test suite produced failures.
ReFrame Summary
[ FAILED ] Ran 4/4 test case(s) from 4 check(s) (4 failure(s), 0 expected failure(s), 0 skipped, 0 aborted)
Details
✅ job output file slurm-2201111.out
❌ found message matching ERROR:
❌ found message matching [\s*FAILED\s*].*Ran .* test case
Nov 06 10:29:34 UTC 2026 uploaded transfer of eessi-2026.06-software-linux-aarch64-a64fx-17939604490.tar.zst to S3 bucket succeeded

@bedroge

bedroge commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Staging PR merged

@casparvl
casparvl merged commit 3155bba into EESSI:main Nov 6, 2026
126 of 132 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants