Fix periodic ib issues#1618
Conversation
…ty when computing the radial vector
…umber of IB force communications. This limits the number of transmits and prevents double-counting in periodic cases.
|
Claude Code Review Head SHA: 4a2cb4c Files changed:
Findings: 1.
else ! general case
count = 0
moment = 0._wp ! zeros the intent(out) dummy
...
else if (sqrt(sum(moment**2)) < sgm_eps) then ! 0 < sgm_eps — always true
moment = 1._wp
return ! numerical integration below never runs
else
normal_axis = moment/sqrt(sum(moment**2)) ! unreachable
end if
! ... volume-integration loop — never reached for 3D general geometry
moment = moment*patch%mass/(count*cell_volume)In the old code 2.
! m_time_steppers.fpp:759
if (num_dims == 3) call s_compute_moment_of_inertia(patch_ib(i), patch_ib(i)%angular_vel)
! m_time_steppers.fpp:761
patch_ib(i)%angular_vel = patch_ib(i)%angular_vel/patch_ib(i)%momentAfter the call, 3.
integer, dimension(:), allocatable :: ib_gbl_idx_lookup
$:GPU_DECLARE(create='[ib_gbl_idx_lookup]')
|
|
Fixed all of the bugs that I have been made aware of, and now all minimum-reproducers I was given behave as anticipated. Final list of bugfixes:
Will add an example to make sure we don't regress on this. |
…her domain and that collide periodically
…C into fix-periodic-ib-issues
|
Did a lot of debugging here and determined that this is a machine-precision issue with the levelset. If I compute the levelset on the CPU always and gopy to the GPU, the GPU test passes the test suite. This makes me quite sad. The test is pretty poorly posed. I can get around this for now, but it is another time that this issue has cropped up. |
…nt errors causing larger divergence
…r named loops in GPU regions, causing a hang. It also was defaulting the z bounds to int max, forcing the periodic collision check loop to cycle for over 30 min.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1618 +/- ##
==========================================
+ Coverage 60.39% 60.43% +0.04%
==========================================
Files 83 83
Lines 19854 19868 +14
Branches 2955 2956 +1
==========================================
+ Hits 11990 12007 +17
+ Misses 5863 5860 -3
Partials 2001 2001 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@sbryngelson can I get approval for case op tests? |
|
you only need approval for benchmark not case opt. though i think case opt only runs once your other tests pass (automatically regardless). |
|
nice work. bench is clean. code is clean. merging. |
Description
I was made aware of several bugs in the IB MPI communication in periodic cases. This branch resolves all of the issues that I have been made aware of. They include
The good news is that the fix for number 2 is also a computational optimization in small cases by limiting the total number of communications to the minimum required to successfully sum. So we have a slight upside.
A new example will be added that should check for this behavior and ensure that it does not break again.
Type of change (delete unused ones)