CMake:HDF5-MPI test on 2 processes: issue warning on failuer, not an …#502
CMake:HDF5-MPI test on 2 processes: issue warning on failuer, not an …#502pdziekan wants to merge 1 commit intoigfuw:masterfrom
Conversation
There was a problem hiding this comment.
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 2execution failure fromFATAL_ERRORtoWARNING. - 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.
| message(STATUS "${msg}: compilation OK, status: ${status}") | ||
| # message(STATUS "${msg} - compilation OK") |
There was a problem hiding this comment.
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.
| message(STATUS "${msg}: compilation OK, status: ${status}") | |
| # message(STATUS "${msg} - compilation OK") | |
| message(STATUS "${msg} - compilation OK") | |
| # message(STATUS "${msg}: compilation OK, status: ${status}") |
| ) | ||
| 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}") |
There was a problem hiding this comment.
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.
| 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}") |
…error