PETSc-FUN3D Code
Lisandro Dalcin
dalcinl at gmail.com
Mon Oct 22 13:47:02 CDT 2007
Sathis, I have not much experience with fortran, but... if you take a
look for example at
http://www.mpi-forum.org/docs/mpi-20-html/node54.htm
you will see
MPI_ALLOC_MEM(SIZE, INFO, BASEPTR, IERROR)
INTEGER INFO, IERROR
INTEGER(KIND=MPI_ADDRESS_KIND) SIZE, BASEPTR
So what the meaning of INTEGER(KIND=MPI_ADDRESS_KIND) is supposed to be??
On 10/22/07, Satish Balay <balay at mcs.anl.gov> wrote:
> On Mon, 22 Oct 2007, Lisandro Dalcin wrote:
>
> > Did you take into accout that MPI defines MPI_Aint for this? I believe
> > we can reuse that definition, perhaps typedefing it as PetscAint or
> > PetscAInt,
> >
> > What do you think?
>
> MPI datatypes are c-only - hence not useful for us. For eg: MPI_Comm,
> MPI_Aint are C datatypes. The equivalent on the fortran side are
> integers. [I guess - the standard wanted to use only the available
> native F77 datatypes].
>
> This usually means there could be a mismatch between fortran & c
> datatypes. [For eg: on 64bit machines, MPI_Aint is 64bit - whereas
> fortran 'integer' is 32bit]. To handle this mismatch - conversion is
> usually necessary between these types in the fortran interface
> routines [using MPI_Fint as an equvalent for fortran integer] for eg:
>
> MPI_Fint fcomm = MPI_Comm_c2f(MPI_Comm comm);
> MPI_Fint foffset = (MPI_Fint)(MPI_Aint offset);
> [i.e int = (int)(long) => possible truncation]
>
> However we try to keep the fortan and C datatypes similar - so that
> such conversions are not necessary. [and we don't have to deal will
> errors associated with them]
>
> Satish
>
>
--
Lisandro Dalcín
---------------
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