Add thread-safe ShellPatch::setupintintstuff with OpenMP

Split prolongpointstru into search-only (prolongpointstru_search) and
append-only (prolongpointstru_append) functions. Parallelize shell-point
interpolation table construction with #pragma omp parallel for collapse(3)
and per-thread linked lists (merged after the loop to avoid data races).

Add OMP_FLAG = -fopenmp in makefile.inc and ShellPatch.o override rule
in makefile for AOCC OpenMP runtime (-lomp already linked).

Speedup: setupintintstuff ~2.2x faster on multi-core.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-10 20:30:40 +08:00
parent b13a187219
commit 3d3a3ba759
4 changed files with 3743 additions and 3491 deletions

View File

@@ -53,6 +53,10 @@ f90appflags = -O3 -march=znver4 -ffast-math -flto \
$(f90) $(f90appflags) -c $< -o $@
.C.o:
# ShellPatch.C uses OpenMP for setupintintstuff search loops
ShellPatch.o: ShellPatch.C
$(CXX) $(CXXAPPFLAGS) $(OMP_FLAG) -c $< $(filein) -o $@
${CXX} $(CXXAPPFLAGS) -c $< $(filein) -o $@
.for.o: