[petsc-dev] dealing with MPIUNi

Barry Smith bsmith at mcs.anl.gov
Fri Feb 26 15:40:52 CST 2010

On Feb 26, 2010, at 3:32 PM, Lisandro Dalcin wrote:

> On 26 February 2010 18:05, Barry Smith <bsmith at mcs.anl.gov> wrote:
>>  Ok, it is still a mess as a special case but I don't see a way  
>> around it if
>> we want users to be able to use the mpi.h and mpif.h directly. So  
>> it is back
>> to adding the -Iinclude/mpiuni to the search directories. But there  
>> is never
>> a libmpiuni.a
> I still think that we should have an autogenerated "petscmpi.h" in
> $PETSC_DIR/$PETSC_ARCH/include ... If third party code are using all
> the niceties PETSc's Makefile infrastructure and moreover want to use
> the PETSc-provided fake MPI without ever bothering for managing
> include dirs, libraries and library dirs, I think it is reasonable to
> ask these codes to change "mpi.h" -> "petscmpi.h" ... However, I
> understand this could not work at all for Fortran 90 modules

    I tried this and had it working but got resistence, here is the  

    Say a user has and application that depends on two sets of  
libraries both using MPI, say liba uses PETSc and is built using  
PETSc's makefile infrastructure. Meanwhile libb has nothing to do with  
PETSc and has no explicit support for compiling without MPI.  People  
want to build the entire application without MPI. Say also libb is  
used in other applications that have nothing to do with PETSc.

1) Your solution. Go into non-PETSc code and hardwire in petscmpi.h  
instead of mpi.h, but since libb is used in other apps without PETSc  
they need to ifdef when to use petscmpi.h instead of mpi.h

2) The previous PETSc mpiuni model. User does not change libb source  
code at all, instead they just compile against -Iinclude/mpiuni when  
they want to use it with PETSc and no MPI.

   Unfortunately MPIUNI seems to require a series of compromises for  
different persons needs and hence is a bit of a hodge-podge, I don't  
see a way around this to be completely clean and make everyone happy,


> -- 
> Lisandro Dalcin
> ---------------
> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
> Tel/Fax: +54-(0)342-451.1594

More information about the petsc-dev mailing list