[petsc-users] PetscTableCreateHashSize

Jed Brown jed at jedbrown.org
Mon Jan 9 16:22:57 CST 2017


Satish Balay <balay at mcs.anl.gov> writes:

> On Mon, 9 Jan 2017, Jed Brown wrote:
>
>> Satish Balay <balay at mcs.anl.gov> 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.
>
> Not sure I understand - are you saying coprime requirement is easier
> satisfy than a single prime?

Yeah, just don't be a multiple of PETSC_HASH_FACT, which is itself
prime.

> I had switched this code to use double-hasing algorithm - and the
> requirement here is - the table size be a prime number. [so I'm
> attempting to estimate a prime number suitable for the table size]

Why is it not sufficient to be coprime?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 800 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170109/eda233ec/attachment.pgp>


More information about the petsc-users mailing list