Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
450ff9f
Replaced ib step dir to always read the correct IB files for the time…
danieljvickers Oct 17, 2025
1257732
Resolved serial IO issue:
danieljvickers Oct 17, 2025
d6e1976
Successfully writing out markers with parallel io except for initial …
danieljvickers Oct 20, 2025
a24ff39
IO is working
danieljvickers Oct 20, 2025
64a57bb
mostly working, but original levelset not changing
danieljvickers Oct 21, 2025
71dc556
Back to working rectangle case with moving IBs
danieljvickers Oct 21, 2025
f02636d
Finished porting all IB marker compute to the GPU
danieljvickers Oct 22, 2025
8965ae2
Full GPU support working for airfoils
danieljvickers Oct 22, 2025
e87fbff
Removed depricated code
danieljvickers Oct 22, 2025
240c588
Removed some unused variables and parallelized more levelset calculat…
danieljvickers Oct 24, 2025
77c1432
All levelsets updated for GPU compute
danieljvickers Oct 24, 2025
bd6096b
Passed test suite of IBM cases
danieljvickers Oct 24, 2025
91b256f
Ran formatting
danieljvickers Oct 24, 2025
0389b67
The premature data save fixes MIBM frame 0 data, but ruins test suite…
danieljvickers Oct 24, 2025
eae1974
Added something that may fix the cray issue
danieljvickers Oct 27, 2025
3dc61e0
Intermittend commit
Oct 29, 2025
e1591e3
Passes cray compiler tests
Oct 29, 2025
a301fbc
Modified all GPU parallel statements and ran formatting
Oct 29, 2025
7a05539
Fixed IB marker write issue with something more sustainable
danieljvickers Oct 29, 2025
21b79e4
Merge branch 'master' into mibm-gpu-optimization-and-io-bugs
danieljvickers Oct 29, 2025
76ec5ed
Fixed bug with centroid and length not being comunicated over MPI
danieljvickers Oct 30, 2025
1cdbbe3
Merge branch 'mibm-gpu-optimization-and-io-bugs' of github.com:daniel…
danieljvickers Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 95 additions & 101 deletions src/common/m_compute_levelset.fpp
Copy link
Contributor

Choose a reason for hiding this comment

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

High-level Suggestion

To improve code clarity and reduce redundancy, refactor the patch_ib derived type to store geometric properties like centroids as arrays directly. This avoids repeatedly creating local temporary arrays within each GPU-accelerated subroutine. [High-level, importance: 7]

Solution Walkthrough:

Before:

subroutine s_sphere_levelset(ib_patch_id, levelset, levelset_norm)
    ...
    real(wp), dimension(3) :: dist_vec, center
    ...
    center(1) = patch_ib(ib_patch_id)%x_centroid
    center(2) = patch_ib(ib_patch_id)%y_centroid
    center(3) = patch_ib(ib_patch_id)%z_centroid

    $:GPU_PARALLEL_LOOP(..., copyin='[...,center,...]')
    do i = 0, m
        ...
        dist_vec(1) = x_cc(i) - center(1)
        ...
    end do
end subroutine

After:

! In the module defining patch_ib type
type t_patch_ib
  ...
  ! real(wp) :: x_centroid, y_centroid, z_centroid
  real(wp), dimension(3) :: center
  ...
end type

! In the subroutine
subroutine s_sphere_levelset(ib_patch_id, levelset, levelset_norm)
    ...
    ! No local 'center' array and manual copy needed.
    ...
    $:GPU_PARALLEL_LOOP(..., copyin='[...,patch_ib(ib_patch_id)%center,...]')
    do i = 0, m
        ...
        dist_vec(1) = x_cc(i) - patch_ib(ib_patch_id)%center(1)
        ...
    end do
end subroutine

Large diffs are not rendered by default.

Loading
Loading