Skip to content

1538 ib state file per process io#1540

Open
danieljvickers wants to merge 4 commits into
MFlowCode:masterfrom
danieljvickers:1538-ib-state-file-per-process-io
Open

1538 ib state file per process io#1540
danieljvickers wants to merge 4 commits into
MFlowCode:masterfrom
danieljvickers:1538-ib-state-file-per-process-io

Conversation

@danieljvickers
Copy link
Copy Markdown
Member

Description

Integrated IB code with the file_per_process flag, which allows IB state and IB marker data to both be written as file_per_process output. This should optimize file IO for large-scale HPC runs with immersed boundaries.

Closes #1538

Type of change (delete unused ones)

  • New feature

Testing

I ran several iterations of the 2D_mibm_shock_cylinder case on GNU and NVHPC compilers using file_per_process enabled and ib_state_wrt. A restart was performed half-way through the simulation (t_step = 1000) to verify that case restarts work as well.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

Claude Code Review

Head SHA: a6ec4b3

Files changed:

  • 3
  • src/post_process/m_data_output.fpp
  • src/simulation/m_data_output.fpp
  • src/simulation/m_start_up.fpp

Findings

1. Duplicate s_create_directory call — directory always created regardless of existence check
src/simulation/m_data_output.fpp, s_write_parallel_ib_state, file_per_process branch:

if (proc_rank == 0) then
    file_loc = trim(case_dir) // '/restart_data/lustre_' // trim(t_step_string)
    call my_inquire(file_loc, dir_check)
    if (dir_check .neqv. .true.) then
        call s_create_directory(trim(file_loc))   ! conditional — correct
    end if
    call s_create_directory(trim(file_loc))       ! unconditional — bug
end if

The second call s_create_directory(trim(file_loc)) is outside the if (dir_check .neqv. .true.) block and always executes on rank 0, including when the directory already exists. The my_inquire/dir_check guard is rendered meaningless. If s_create_directory errors on an existing directory (e.g. mkdir without -p), this will abort at every timestep after the first write for a given t_step_string.

@danieljvickers
Copy link
Copy Markdown
Member Author

Addressed AI review comment.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

❌ Patch coverage is 16.41791% with 112 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.58%. Comparing base (68dbb6b) to head (c64f071).

Files with missing lines Patch % Lines
src/simulation/m_start_up.fpp 0.00% 48 Missing ⚠️
src/simulation/m_data_output.fpp 39.28% 31 Missing and 3 partials ⚠️
src/post_process/m_data_output.fpp 0.00% 30 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1540      +/-   ##
==========================================
- Coverage   60.80%   60.58%   -0.22%     
==========================================
  Files          73       73              
  Lines       20199    20271      +72     
  Branches     2932     2948      +16     
==========================================
  Hits        12281    12281              
- Misses       5932     6002      +70     
- Partials     1986     1988       +2     

☔ View full report in Codecov by Harness.
📢 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.

IB State File-Per-Process IO

2 participants