Bug fix in m_data_input.f90#938
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where MPI-specific code in m_data_input.f90 was still compiled when using --no-mpi. It does so by wrapping the MPI helper subroutines and related declarations in #ifdef MFC_MPI guards.
- Wrapped
s_setup_mpi_io_paramssubroutine in an#ifdef MFC_MPIblock - Added
#ifdef MFC_MPIaround MPI declarations (status,disp) ins_read_ib_data_files - Enclosed entire
s_read_parallel_conservative_datasubroutine within#ifdef MFC_MPI
Comments suppressed due to low confidence (2)
src/post_process/m_data_input.f90:433
- [nitpick] Since this
#ifdefnow controls compilation ofs_read_parallel_conservative_data, add or update a CI test to ensure the subroutine is excluded when building with--no-mpito prevent accidental regressions.
#ifdef MFC_MPI
src/post_process/m_data_input.f90:111
- [nitpick] The subroutine
s_setup_mpi_io_paramshas more than 6 parameters, exceeding the project guideline. Consider grouping related parameters into a derived type to reduce the argument count.
#ifdef MFC_MPI
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #938 +/- ##
=======================================
Coverage 43.71% 43.71%
=======================================
Files 68 68
Lines 18360 18360
Branches 2292 2292
=======================================
Hits 8026 8026
Misses 8945 8945
Partials 1389 1389 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
User description
Description
(#902) introduced a bug where whenever
--no-mpiwas utilized, mpi-specific variables/subroutines would still be present/used in m_data_input.f90. The PR attempts to fix it by re-arranging MFC_MPI if enclosures (#ifdef MFC_MPI .... #endif). With the new changes,./mfc.sh build -t post_process --no-mpiworks nicely.PR Type
Bug fix
Description
Fixed MPI preprocessor directive placement in data input module
Resolved compilation issues when building with
--no-mpiflagReorganized
#ifdef MFC_MPIblocks to properly isolate MPI-specific codeChanges diagram
Changes walkthrough 📝
m_data_input.f90
Fix MPI preprocessor directive placementsrc/post_process/m_data_input.f90
#ifdef MFC_MPIdirective befores_setup_mpi_io_paramssubroutine#endifafter the subroutine#ifdef MFC_MPIblocks ins_read_ib_data_filess_read_parallel_conservative_data