Skip to content

post_process: extract shared Lagrangian-bubble restart-header read (and name the 5x disp offset)#1525

Closed
lvupupui wants to merge 1 commit into
MFlowCode:masterfrom
lvupupui:feat/extract-lag-restart-header
Closed

post_process: extract shared Lagrangian-bubble restart-header read (and name the 5x disp offset)#1525
lvupupui wants to merge 1 commit into
MFlowCode:masterfrom
lvupupui:feat/extract-lag-restart-header

Conversation

@lvupupui
Copy link
Copy Markdown

@lvupupui lvupupui commented Jun 1, 2026

Closes #1519

Extracts the byte-identical MPI-IO restart-header read block (lines 750–777 / 909–936 of the original file) shared by s_write_lag_bubbles_results_to_text and s_write_lag_bubbles_to_formatted_database_file into a new s_read_lag_restart_header subroutine.

Also consolidates the 5× duplicated disp offset expression: the base form is now computed once inside the helper, keeping only 3 copies of the extended form in divergent code paths.

  • Net: +53 / −60 lines
  • Risk: low (input-side code motion; regression tests exercise this path)

Extract the byte-identical MPI-IO restart-header read block from
s_write_lag_bubbles_results_to_text and
s_write_lag_bubbles_to_formatted_database_file into a new
s_read_lag_restart_header subroutine.

Also consolidates the base header-offset expression (5\xc3\x97 copies
reduced to 1\xc2\xb9 in the shared helper + 3\xc2\xb9 remaining in divergent
code, vs 5\xc2\xb9 before).

The new helper opens the restart file on MPI_COMM_SELF, reads
file_tot_part / file_time / file_dt / file_num_procs, broadcasts,
allocates proc_bubble_counts, then reopens/reads/broadcasts the
per-proc counts.  Risk is low: input-side code motion of an identical
block; downstream output logic is unchanged.

1\xc2\xb9 approximate counts after the patch.
@sbryngelson sbryngelson closed this Jun 1, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

❌ Patch coverage is 82.60870% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.62%. Comparing base (08d12f8) to head (dcb46e3).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/post_process/m_data_output.fpp 82.60% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1525      +/-   ##
==========================================
- Coverage   60.64%   60.62%   -0.02%     
==========================================
  Files          73       73              
  Lines       20213    20198      -15     
  Branches     2936     2933       -3     
==========================================
- Hits        12259    12246      -13     
- Misses       5966     5967       +1     
+ Partials     1988     1985       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

post_process: extract shared Lagrangian-bubble restart-header read (and name the 5x disp offset)

2 participants