| 5bc5884e | 27-May-2022 |
Barry Smith <bsmith@mcs.anl.gov> |
Here is the relevant part of CMake's findMPI()
# If we have an MPI base directory, we'll try all compiler names in that one first. # This should prevent mixing different MPI envi
Here is the relevant part of CMake's findMPI()
# If we have an MPI base directory, we'll try all compiler names in that one first. # This should prevent mixing different MPI environments if(_MPI_BASE_DIR) find_program(MPI_${LANG}_COMPILER NAMES ${_MPI_${LANG}_COMPILER_NAMES} PATH_SUFFIXES bin sbin HINTS ${_MPI_BASE_DIR} NO_DEFAULT_PATH DOC "MPI compiler for ${LANG}" ) endif() # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), # we shall try searching in the default paths. find_program(MPI_${LANG}_COMPILER NAMES ${_MPI_${LANG}_COMPILER_NAMES} PATH_SUFFIXES bin sbin DOC "MPI compiler for ${LANG}" )
The problem comes from --with-mpiexec=srun on Cray systems
Checking for program /usr/bin/srun...found
so that CMake decides _MPI_BASE_DIR is /usr/bin it now looks in there for the cc compiler and finds the wrong one. So the bug is in CMake's findMPI which is using the path of "mpiexec" to categorically decide where the MPI compiler is. (Which is wrong).
Note that CMake findMPI actually finds the correct MPI C++ and Fortran compiler because in the first find() above it cannot find CC so it falls down to search in the regular path and, of course, finds the correct compilers.
Commit-type: portability-fix /spend 1.2h Reported-by: Jin Chen <jchen@pppl.gov> Thanks-to: Yang Liu <liuyangzhuan@lbl.gov>
show more ...
|
| 49c86fc7 | 01-May-2022 |
Barry Smith <bsmith@mcs.anl.gov> |
Add proper support for PetscCall(), PetscCallMPI() for Fortran
Also add support for PetscCallA(), PetscCallMPIA() for Fortran that abort
Provide support for printing the Fortran line and filenames
Add proper support for PetscCall(), PetscCallMPI() for Fortran
Also add support for PetscCallA(), PetscCallMPIA() for Fortran that abort
Provide support for printing the Fortran line and filenames with the errors or not depending on how long Fortran source code lines can be
Minor improvements to handling calls to PetscError() with no function string
Commit-type: error-checking, feature /spend 2h
show more ...
|