[petsc-users] long int

Matthew Knepley knepley at gmail.com
Sun Jun 12 13:38:32 CDT 2011


On Sun, Jun 12, 2011 at 1:33 PM, Mohammad Mirzadeh <mirzadeh at gmail.com>wrote:

> Thanks Barry. Problem is my indices are all long and if I use the with
> petsc the compiler  will complain. Do you think casting them to int will
> solve the problem? Also how does 64 bit international affect petsc
> performance?
>

The words here are too imprecise:

  short int: A 2 byte integer
  long  int: A 4 byte integer
  int:          An integer which can be short or long, depending on the
compiler, but most often long int today
  long long int: An 8 byte integer

The --with-64-bit-indices flag gives long long ints. If you have > 2B
unknowns, use this, otherwise don't. Yes, it slows things down.
On every 64-bit architecture I know, 'int' is still 'long int', not 'long
long int'. The only thing that is 64-bit is the pointers.

   Matt

> Thanks
> On Jun 12, 2011 9:39 AM, "Barry Smith" <bsmith at mcs.anl.gov> wrote:
> >
> > On Jun 12, 2011, at 1:48 AM, Mohammad Mirzadeh wrote:
> >
> >> I guess I figured it out. On 64-bit OS long long and long are the same
> and I may as well just use --with-64-bit-ints flag.
> >
> > You only need to configure PETSc with --with-64-bit-indices if you are
> dealing with problems with over 2 billion unknowns (in parallel) or if the
> sparse matrix will have more than 2 billion nonzeros on a single process.
> You do not need to use --with-64-bit-indices just because you are using 64
> bit pointers, only for really large problems.
> >
> >
> > Barry
> >
> >>
> >> Thanks
> >>
> >>
> >> On Sat, Jun 11, 2011 at 11:22 PM, Mohammad Mirzadeh <mirzadeh at gmail.com>
> wrote:
> >> Hi guys,
> >>
> >> How can I use long int instead of PetscInt in the functions? Does simply
> changing the definition of PetscInt solve the problem?
> >>
> >> Thanks
> >>
> >
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110612/65d09422/attachment.htm>


More information about the petsc-users mailing list