[petsc-users] 64 bit integers

Satish Balay balay at mcs.anl.gov
Fri Aug 17 11:11:44 CDT 2012


If you are calling a petsc function that expects PetscInt - then the
following coulde would be a bug:

/* VecSetSizes(Vec,PetscInt,PetscInt) */

          integer nlocal,nglobal
          Vec v
          call VecSetSizes(v,nlocal,nglobal)

It should be:

          PetscInt nlocal,nglobal
          Vec v
          call VecSetSizes(v,nlocal,nglobal)

Satish


On Fri, 17 Aug 2012, Michele Rosso wrote:

> Thank you.
> How can I convert?
> 
> Michele
> 
> On 08/17/2012 08:55 AM, Matthew Knepley wrote:
> > On Fri, Aug 17, 2012 at 10:16 AM, Jed Brown <jedbrown at mcs.anl.gov
> > <mailto:jedbrown at mcs.anl.gov>> wrote:
> > 
> >     On Fri, Aug 17, 2012 at 10:12 AM, Michele Rosso <mrosso at uci.edu
> >     <mailto:mrosso at uci.edu>> wrote:
> > 
> >         Does this mean that Fortran compiler invoked by the PETSc
> >         Makefile will
> >         compile to code with the 64 bit integer option so that also
> >         Fortran Integer will be 64 bit?
> > 
> > 
> >     NO, that would be bad because it breaks library interfaces.
> > 
> >     You have to use the right types internally. If you use PetscInt
> >     everywhere, then you'll be fine. If you mix types, you have to
> >     find out where to convert.
> > 
> > 
> > I meant that if you use PetscInt in Fortran it was also be a 64-bit integer.
> > 
> >    Matt
> > 
> > -- 
> > What most experimenters take for granted before they begin their experiments
> > is infinitely more interesting than any results to which their experiments
> > lead.
> > -- Norbert Wiener
> 
> 



More information about the petsc-users mailing list