Skip to content

CMake:HDF5-MPI test on 2 processes: issue warning on failuer, not an …#502

Open
pdziekan wants to merge 1 commit intoigfuw:masterfrom
pdziekan:cmake_hdf5_fix
Open

CMake:HDF5-MPI test on 2 processes: issue warning on failuer, not an …#502
pdziekan wants to merge 1 commit intoigfuw:masterfrom
pdziekan:cmake_hdf5_fix

Conversation

@pdziekan
Copy link
Copy Markdown
Contributor

…error

Copilot AI review requested due to automatic review settings March 26, 2026 14:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the CMake-time MPI-HDF5 usability check to be less strict when running a 2-process MPI execution test, aligning configuration behavior with constrained CI/HPC environments.

Changes:

  • Downgrades the 2-process ${libmpdataxx_MPIRUN} -np 2 execution failure from FATAL_ERROR to WARNING.
  • Improves status output messages for the compile and mpirun execution steps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +264 to +265
message(STATUS "${msg}: compilation OK, status: ${status}")
# message(STATUS "${msg} - compilation OK")
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try_compile() sets the result variable to a boolean (e.g., TRUE/FALSE), so printing status here is likely not very informative and may confuse users expecting an exit code. Consider either omitting status from the success message or printing more useful details (e.g., compiler output only on failure) while keeping status as a boolean check.

Suggested change
message(STATUS "${msg}: compilation OK, status: ${status}")
# message(STATUS "${msg} - compilation OK")
message(STATUS "${msg} - compilation OK")
# message(STATUS "${msg}: compilation OK, status: ${status}")

Copilot uses AI. Check for mistakes.
)
if (NOT status EQUAL 0)
message(FATAL_ERROR "TODO: ${status}\n ${error}")
message(WARNING "mpirun --np 2 failed, this could be normal e.g. if compilation is done in a job that has only 1 process allocated: ${status}\n ${error}")
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning message hard-codes mpirun --np 2, but the command being executed is ${libmpdataxx_MPIRUN} -np 2 .... To avoid misleading diagnostics (and the --np vs -np mismatch), include ${libmpdataxx_MPIRUN} and the actual args in the warning text.

Suggested change
message(WARNING "mpirun --np 2 failed, this could be normal e.g. if compilation is done in a job that has only 1 process allocated: ${status}\n ${error}")
message(WARNING "${libmpdataxx_MPIRUN} -np 2 ./test_hdf5_mpi failed, this could be normal e.g. if compilation is done in a job that has only 1 process allocated: ${status}\n ${error}")

Copilot uses AI. Check for mistakes.
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.

2 participants