Re: [petsc-users] PetscTableCreateHashSize

2017-01-10 Thread Satish Balay
With configure option: --with-ctable= Satish On Tue, 10 Jan 2017, Kong, Fande wrote: > BTW, one more question: > > There are some pieces of code in #if defined(PETSC_USE_CTABLE) #endif. > How to disable ctable? That is, make PETSC_USE_CTABLE false during > configuration. > > Fande, >

Re: [petsc-users] PetscTableCreateHashSize

2017-01-10 Thread Kong, Fande
BTW, one more question: There are some pieces of code in #if defined(PETSC_USE_CTABLE) #endif. How to disable ctable? That is, make PETSC_USE_CTABLE false during configuration. Fande, On Tue, Jan 10, 2017 at 12:33 AM, Jed Brown wrote: > Satish Balay

Re: [petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Jed Brown
Satish Balay writes: > I tried looking at it - but it was easier for me to fixup current ctable code. I mentioned it more as a long-term thing. I don't think we need two different hashtable implementations in PETSc. I think khash is better and extensible, so we may as well

Re: [petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Satish Balay
On Mon, 9 Jan 2017, Jed Brown wrote: > Satish Balay writes: > > >> Why is it not sufficient to be coprime? > > > > Well whatever was implemented previsously with PETSC_HASH_FACT [a > > prime number] didn't work well. [there were a couple of reports on it]. > > That was

Re: [petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Jed Brown
Satish Balay writes: >> Why is it not sufficient to be coprime? > > Well whatever was implemented previsously with PETSC_HASH_FACT [a > prime number] didn't work well. [there were a couple of reports on it]. That was linear probing, right? > Checking double hashing [Intro to

Re: [petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Satish Balay
On Mon, 9 Jan 2017, Jed Brown wrote: > Satish Balay writes: > > > On Mon, 9 Jan 2017, Jed Brown wrote: > > > >> Satish Balay writes: > >> > Sure - I'm using a crappy algorithm [look-up table] to get > >> > "prime_number_close_to(1.4*sz)" - as I don't know

Re: [petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Satish Balay
I've added up to INT_MAX Let us know if that doesn't work. Satish On Mon, 9 Jan 2017, Kong, Fande wrote: > Thanks a lot Satish! > > Like Jed said, it would be better if we could come up an algorithm for > automatically computing a hash size for a given n. Otherwise, we may need > to add

Re: [petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Jed Brown
Satish Balay writes: > On Mon, 9 Jan 2017, Jed Brown wrote: > >> Satish Balay writes: >> > 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. >>

Re: [petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Kong, Fande
Thanks a lot Satish! Like Jed said, it would be better if we could come up an algorithm for automatically computing a hash size for a given n. Otherwise, we may need to add more entries to the lookup again in the future. Fande, On Mon, Jan 9, 2017 at 2:14 PM, Satish Balay

Re: [petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Satish Balay
On Mon, 9 Jan 2017, Jed Brown wrote: > Satish Balay writes: > > 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. > > FWIW, it only needs to be coprime with

Re: [petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Jed Brown
Satish Balay writes: > 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. FWIW, it only needs to be coprime with PETSC_HASH_FACT. signature.asc Description: PGP

Re: [petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Satish Balay
On Mon, 9 Jan 2017, Jed Brown wrote: > Satish Balay 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

Re: [petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Jed Brown
Satish Balay 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 >

Re: [petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Kong, Fande
Thanks, Satish, On Mon, Jan 9, 2017 at 12:36 PM, Satish Balay wrote: > We can add more entries to the lookup. The stack below looks > incomplete. Which routine is calling PetscTableCreateHashSize() with > this big size? > call trace: [4]PETSC ERROR: #3

Re: [petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Satish Balay
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 +++

[petsc-users] PetscTableCreateHashSize

2017-01-09 Thread Kong, Fande
Hi All, Hash size is set manually according to the number of expected keys in the function PetscTableCreateHashSize(). Any reason to restrict the ``n"<3276800? One user here encountered an issue because of this restriction. The messages are as follows: [3]PETSC ERROR: -