[petsc-dev] detecting the wrong mpi.h

Barry Smith bsmith at mcs.anl.gov
Fri Jul 11 22:36:24 CDT 2014


   Can at configure time we determine some information about the mpi.h that is being included and then store it in petscconf.h and have petscsys.h check it for all compiles so that that the difficult to debug problem of “wrong mpi.h” included is easier to deal with?

   For example in petscsys.h

#if defined(PETSC_MPICH_VERSION)   /* means PETSc was configured with MPICH */
#if !defined(MPICH_VERSION) 
   error the mpi.h included is not that which PETSc was configured with
#else
#if PETSC_MPICH_VERSION != MPI_VERSION 
   error the mpi.h included is a different version then PETSc was configured with 
#endif
#endif

and some similar check for other MPI implementations that contain some identifying information

   Barry






More information about the petsc-dev mailing list