Repository navigation
LANDISDisp: optional OpenMP threads for the spiral scan - #256
Open
eliotmcintire wants to merge 8 commits into
Open
eliotmcintire wants to merge 8 commits into
eliotmcintire wants to merge 8 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
eliotmcintire
force-pushed
the
perf/dispersal-openmp
branch
from
September 30, 2026 14:57
fac5165 to
cd89cb4
Compare
…ers, fork safety) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
eliotmcintire
added a commit
that referenced
this pull request
Oct 1, 2026
LANDISDisp: optional OpenMP threads for the spiral scan Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
NEWS only: keep both sides' entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings a86df7b, the R reference fix that makes the R/C++ parity tests pass on macOS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eliotmcintire
added a commit
that referenced
this pull request
Oct 3, 2026
LANDISDisp: optional OpenMP threads for the spiral scan Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NEWS.md was the only conflict; both entries kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
NEWS: keep both sides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
eliotmcintire
marked this pull request as ready for review
October 16, 2026 00:08
eliotmcintire
added a commit
that referenced
this pull request
Oct 16, 2026
LANDISDisp: optional OpenMP threads for the spiral scan Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Seed dispersal can now use several processor cores for its slowest step, making it about twice as fast with 4 cores. Results are identical no matter how many cores are used, and the default is still one core.
Affects: run time only, and only when more cores are turned on.
Technical details
The receiver scan in
spiralLoopCpp(src/spiralSeedDispersal.cpp) is the one serial part that uses no RNG, so it now runs under OpenMP whenoptions(LandR.LANDISDisp.threads = n)is above 1 (default 1) and a step has at least 20000 active receivers. It uses a static schedule with one hit buffer per thread, joined in thread order, so the receiver order matches the serial loop. The uniform draws, success test and compaction stay serial on the main thread, so output is bit-identical for any thread count and touseCpp = FALSE. OpenMP is guarded with#ifdef _OPENMP, andsrc/Makevarsandsrc/Makevars.winadd$(SHLIB_OPENMP_CXXFLAGS).Verified with a new test-LANDISDisp-threads.R (
expect_identicalfor threads 1, 2, 4 and the R reference, skipped without OpenMP), plus the parity, seedLocked (LANDR_SLOW_TESTS=1), wardScreen and pgv tests, all passing.Timing on the xxxlarge fixture (9M cells, pgv supplied, verbose 0, median of 5): the whole
LANDISDispcall takes 0.72 s on #255 and 0.63 s, 0.39 s and 0.35 s here with 1, 2 and 4 threads, so about twice as fast at 4 threads. The threshold made no measurable difference at 5000, 20000 or 100000, so 20000 is kept. An earlier version of this description reported a smaller gain; its benchmark timedspiralLoopCppwith a nestedsystem.time(), whose defaultgcFirst = TRUEadded a full garbage collection (~0.55 s) to every whole-call time.🤖 Generated with Claude Code
https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv