Réf. : Re: Fortran integer declaration in petscdef.h

Thomas DE-SOZA thomas.de-soza at edf.fr
Mon Apr 7 11:05:06 CDT 2008

The reason I was asking about this is that in a previous version of PETSc 
(2.3.2p10) we had had to modify petscdef.h in order to comply with our 
code. Indeed our code is written mainly in Fortran77 with its own memory 
manager (it is 20 years old) and to take full advantage of architectures 
with a lot of memory we need to compile it with -i8 option (intel compiler 
syntax) so that integers are 64bits wide. We use PETSc as a solver with 
this code.
So PETSc was first compiled separetely in standard 32 bits mode, then the 
PETSc Fortran interface to our code was compiled with the options -i8 and 
it was messy (we encountered errors during initialization in MPI).
Recently we updated to the latest 2.3.3 version and found out that you had 
updated petscdef.h so that it defines correctly integer*4 and integer*8 
when necessary. We didn't modify anything this time and it seems to work 
OK. I looked closely at petscdef.h and saw that these two lines were the 
only ones left as "integer", that's why I asked the question.

owner-petsc-dev at mcs.anl.gov
07/04/2008 17:02
Veuillez répondre à petsc-dev

        Pour :  petsc-dev at mcs.anl.gov
        cc :    (ccc : Thomas DE-SOZA/RETD/EDFGDF/FR)
        Objet : Re: Fortran integer declaration in petscdef.h

On Mon, 7 Apr 2008, Thomas DE-SOZA wrote:

> Hi,
> I was wondering if in $PETSC_DIR/include/finclude/petscdef.h :
>     50  #if defined(PETSC_HAVE_MPIUNI)
>     51  #define MPI_Comm PetscFortranInt
>     52  #define PetscMPIInt PetscFortranInt
>     53  #else
>     54  #define MPI_Comm integer
>     55  #define PetscMPIInt integer
>     56  #endif
> the integer declaration should not be changed to something dependent on 

Hmm - not sure I understand this.

MPI standard defines MPI_Comm on fortran side as integer. So the lines
54, 55 are correct.

Wrt MPIUNI - it doesn't attempt to comply with MPI standard. The
correct MPI compliant software for np=1 is MPICH. [MPIUNI defaults to
using a datatype equivalent to C integer for convinence]


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20080407/8a82dca0/attachment.html>

More information about the petsc-dev mailing list