Satish Balay <[email protected]> writes: > On Mon, 9 Jan 2017, Jed Brown wrote: > >> Satish Balay <[email protected]> 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?
signature.asc
Description: PGP signature
