Skip to content

fix(input): broadcast parser errors before MPI exits - #33

Draft
Stardust0831 wants to merge 2 commits into
review/input-parser-base-20261024from
fix/input-parser-mpi-exit
Draft

Stardust0831 wants to merge 2 commits into
review/input-parser-base-20261024from
fix/input-parser-mpi-exit

Conversation

@Stardust0831

Copy link
Copy Markdown
Owner

Fork review draft based on upstream develop at 89595dd29.

When INPUT has a missing header, an unknown parameter or a repeated parameter, the old parser exits on rank zero while other MPI ranks are waiting for a broadcast. File-open and stream failures have the same problem. These errors now return to the shared error broadcast, so every rank receives the reason before exiting. Diagnostics identify the input file; parameter and syntax errors also link to the manual.

This addresses the MPI parser follow-up recorded in upstream #8192, continuing #7719. Accepted parameter values and contextual defaults are unchanged. The change is confined to input parsing, tests and the developer guide; calculation modules are unaffected.

Validation uses the real reader and exit handler. Seven four-process CTest cases cover file/header/name/duplicate errors, malformed values, conflicting parameters and a valid input. A test-only exit hook collectively finalizes MPI and confirms all four processes reached shutdown, preventing the launcher from masking a rank-zero-only exit. Each process group has a 30-second timeout. Rebuilding the test against the original parser reproduced the timeout for an unknown parameter; the fixed parser passes.

Local validation: seven MPI cases, 41 serial reader/item tests, 13 executable input checks, and serial/four-process Si SCF calculations passed. The executables report v3.11.0-beta11; builds used GCC 13.4, Release mode, BUILD_TESTING=ON, ENABLE_OPENMP=ON, ENABLE_LCAO=OFF, ENABLE_ELPA=OFF and ENABLE_FLOAT_FFTW=OFF, with OMP_NUM_THREADS=1 at runtime.

Build and test commands

SERIAL_BUILD and MPI_BUILD denote the corresponding build directories (ENABLE_MPI=OFF and ON).

cmake --build "$SERIAL_BUILD" --target MODULE_IO_input_domain_reader \
  MODULE_IO_read_item_serial MODULE_IO_read_input_serial abacus_pw_omp -j 8
ctest --test-dir "$SERIAL_BUILD" -V \
  -R '^MODULE_IO_(input_domain_reader|read_item_serial|read_input_serial)$'

cmake --build "$MPI_BUILD" --target MODULE_IO_input_error_mpi abacus_pw_para -j 8
ctest --test-dir "$MPI_BUILD" -V -R '^MODULE_IO_input_error_mpi_'

The existing successful MPI --check-input path exits without MPI finalization and is reported as an improper exit by the local Open MPI launcher. It is outside this parser-error fix: MPI executable checks used normal execution, including a complete Si SCF; the CTest driver supplies collective shutdown explicitly.

Staged governance and whitespace checks passed. No governance exceptions are requested.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant