Skip to content

Changed platform erosion to take cell arg and started parallelisation#171

Open
wilfchun wants to merge 1 commit intodevelopfrom
feature/parallel-patform-erode
Open

Changed platform erosion to take cell arg and started parallelisation#171
wilfchun wants to merge 1 commit intodevelopfrom
feature/parallel-patform-erode

Conversation

@wilfchun
Copy link
Collaborator

This pull request refactors the shore platform erosion logic to improve performance and thread safety, particularly in the context of parallel processing. The main change is to reduce repeated array lookups by passing a cell reference, and to make certain operations thread-safe when running in parallel with OpenMP.

Key improvements include:

Performance and Code Clarity:

  • Refactored DoActualPlatformErosionOnCell to accept a CGeomCell& reference, reducing repeated array lookups and improving code readability. All internal cell accesses now use this reference instead of repeated grid indexing. [1] [2] [3] [4] [5] [6] [7] [8]

Parallelization and Thread Safety:

  • Added OpenMP parallelization to the main erosion loop in nDoAllShorePlatFormErosion, including reductions for relevant variables to safely accumulate results in parallel.
  • Introduced OpenMP critical sections to protect thread-unsafe operations: random shuffling of directions and updates to polygon sediment data, ensuring correctness during concurrent execution. [1] [2]

Dependency and Header Updates:

  • Added missing include for cell.h and forward declaration for CGeomCell to support the new function signature and usage. [1] [2]

@wilfchun wilfchun added enhancement New feature or request feature labels Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant