[petsc-dev] Install location for MPIUNI mpi.h

Smith, Barry F. bsmith at mcs.anl.gov
Wed Apr 25 14:27:15 CDT 2018



> On Apr 25, 2018, at 1:36 PM, Jed Brown <jed at jedbrown.org> wrote:
> 
> It is currently installed to include/petsc/mpiuni/mpi.h and petscsys.h
> includes it as <mpi.h>, which means that users of MPIUNI need to put
> -I/prefix/include/petsc/mpiuni in their command lines.  Matt and I agree
> that this is bad.  We disagree on the solution.
> 
> He wants to install it to /prefix/include/mpi.h as though the user had
> written --download-mpich.  This would conflict if a user later installs
> a real MPI to that location.

  Jed,

   So you propose in petscsys.h ?

#if defined(PETSC_HAVE_MPIUNI)
#include <petsc/mpiuni/mpi.h> 
#else
#include <mpi.h>
#endif

  I don't have a problem with this.

I notice that the Fortran petscsys.h is scattered full of weird MPIUni specific stuff like

#if defined (PETSC_HAVE_MPIUNI)
#include "mpiunifdef.h"
#endif

#if defined(PETSC_HAVE_MPIUNI)
#define MPI_Comm PetscFortranInt
#define MPI_Group PetscFortranInt
#define PetscMPIInt PetscFortranInt
#else
#define MPI_Comm integer
#define MPI_Group integer
#define PetscMPIInt integer
#endif

It seems PETSc Fortran does not use the standard mpif.h file? 

   Barry




> 
> I would rather that petscsys.h include <petsc/mpiuni/mpi.h> because it
> can't be used without PETSc and nobody who ever wrote #include <mpi.h>
> in their own code will be happy if they get MPIUNI.



More information about the petsc-dev mailing list