<div dir="ltr"><div>Thanks a lot Satish!<br></div><div><br>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.<br><br></div>Fande,<br> </div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 9, 2017 at 2:14 PM, Satish Balay <span dir="ltr"><<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, 9 Jan 2017, Jed Brown wrote:<br>
<br>
</span><div><div class="h5">> Satish Balay <<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>> writes:<br>
> > Sure - I'm using a crappy algorithm [look-up table] to get<br>
> > "prime_number_close_to(1.4*sz)<wbr>" - as I don't know how to generate<br>
> > these numbers automatically.<br>
><br>
> FWIW, it only needs to be coprime with PETSC_HASH_FACT.<br>
<br>
</div></div>Not sure I understand - are you saying coprime requirement is easier<br>
satisfy than a single prime?<br>
<br>
I had switched this code to use double-hasing algorithm - and the<br>
requirement here is - the table size be a prime number. [so I'm<br>
attempting to estimate a prime number suitable for the table size]<br>
<br>
I pushed the following<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__bitbucket.org_petsc_petsc_commits_d742c75fd0d514f7fa1873d5b10984bc3f363031&d=DQIBAg&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=DUUt3SRGI0_JgtNaS3udV68GRkgV4ts7XKfj2opmiCY&m=nkPXHuaxZeHPzOteY25j_Dptk5XyWiqwzaJbEwI5uWY&s=eOjfGCXP3g18VLYhXY5xrlOr7AFn7o3G_YrYVo8Rw8Y&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.<wbr>com/v2/url?u=https-3A__<wbr>bitbucket.org_petsc_petsc_<wbr>commits_<wbr>d742c75fd0d514f7fa1873d5b10984<wbr>bc3f363031&d=DQIBAg&c=<wbr>54IZrppPQZKX9mLzcGdPfFD1hxrcB_<wbr>_aEkJFOKJFd00&r=DUUt3SRGI0_<wbr>JgtNaS3udV68GRkgV4ts7XKfj2opmi<wbr>CY&m=nkPXHuaxZeHPzOteY25j_<wbr>Dptk5XyWiqwzaJbEwI5uWY&s=<wbr>eOjfGCXP3g18VLYhXY5xrlOr7AFn7o<wbr>3G_YrYVo8Rw8Y&e=</a><br>
<span class="HOEnZb"><font color="#888888"><br>
Satish<br>
</font></span></blockquote></div><br></div>