Add OpenACC routine seq directives for GPU support#223
Open
krystophny wants to merge 2 commits intomainfrom
Open
Add OpenACC routine seq directives for GPU support#223krystophny wants to merge 2 commits intomainfrom
krystophny wants to merge 2 commits intomainfrom
Conversation
5 tasks
Add !$acc routine seq to batch spline evaluation functions so they can be called from within GPU kernels: - batch_interpolate_1d.f90: evaluate_batch_splines_1d_der2/der3 and _many variants - batch_interpolate_3d.f90: evaluate_batch_splines_3d_der/der2 and _many/_core variants - canonical_coordinates_mod.f90: !$acc declare for nper, torflux, icounter, rnegflag These changes enable SIMPLE particle tracing to run on GPU via OpenACC.
The combination of !$omp threadprivate and !$acc declare on the same variable triggers an internal compiler error in GCC 16. Additionally, OpenMP threadprivate and OpenACC device memory are fundamentally incompatible - threadprivate gives each thread its own copy, while OpenACC puts data in shared device memory. The module variables (rnegflag, icounter, nper, torflux) are now handled via explicit data management in SIMPLE's initialization routines instead of module-level declarations.
5bed409 to
9d9f694
Compare
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.
Summary
Add
!$acc routine seqdirectives to batch spline evaluation functions to enable GPU execution via OpenACC.Changes
batch_interpolate_1d.f90: Added!$acc routine seqtoevaluate_batch_splines_1d_der2,evaluate_batch_splines_1d_der3, and their_manyvariantsbatch_interpolate_3d.f90: Added!$acc routine seqtoevaluate_batch_splines_3d_der,evaluate_batch_splines_3d_der2, and their_many/_corevariantscanonical_coordinates_mod.f90: Added!$acc declarefor module variables (nper,torflux,icounter,rnegflag)Purpose
These changes allow SIMPLE particle tracing to run on GPU via OpenACC with GCC 16 + nvptx offload. The
!$acc routine seqdirective marks routines for sequential execution within GPU kernels, while!$acc declaremakes module variables available on device.Notes