[petsc-users] PetscTableCreateHashSize
Satish Balay
balay at mcs.anl.gov
Mon Jan 9 13:52:57 CST 2017
On Mon, 9 Jan 2017, Jed Brown wrote:
> Satish Balay <balay at mcs.anl.gov> writes:
>
> > We can add more entries to the lookup. The stack below looks
> > incomplete. Which routine is calling PetscTableCreateHashSize() with
> > this big size?
> >
> > Satish
> >
> > -------
> > $ git diff
> > diff --git a/src/sys/utils/ctable.c b/src/sys/utils/ctable.c
> > index cd64284..761a2c6 100644
> > --- a/src/sys/utils/ctable.c
> > +++ b/src/sys/utils/ctable.c
> > @@ -25,6 +25,7 @@ static PetscErrorCode PetscTableCreateHashSize(PetscInt sz, PetscInt *hsz)
> > else if (sz < 819200) *hsz = 1193557;
> > else if (sz < 1638400) *hsz = 2297059;
> > else if (sz < 3276800) *hsz = 4902383;
> > + else if (sz < 6553600) *hsz = 9179113;
>
> Does anyone else think this is ridiculous? Why not either generate the
> hash sizes algorithmically or put in enough for MAXINT?
Sure - I'm using a crappy algorithm [look-up table] to get
"prime_number_close_to(1.4*sz)" - as I don't know how to generate
these numbers automatically.
Will add more entries to this lookup table.
Satish
More information about the petsc-users
mailing list