We're taking the max of three ints and assigning the result to an int8. Obviously the grid refinement needs an overhaul anyway, but in the meantime we can squash this bug.
Expected behavior
Grid refinement is only triggered for max_nmesh < BOOST_CELL_THRESH (=10) or avg_np >= BOOST_NUMPART_THRESH (=25)
Running with points in [xmin,xmax] = 1.033422,998.203714 with periodic wrapping = 1000.000000
Running with points in [ymin,ymax] = 0.129471,999.796202 with periodic wrapping = 1000.000000
Running with points in [zmin,zmax] = 0.990155,999.890578 with periodic wrapping = 1000.000000
In gridlink_index_particles_double> Running with [nmesh_x, nmesh_y, nmesh_z] = 250,250,250. Time taken = 3.544 sec
countpairs_double> gridlink seems inefficient. nmesh = (250, 250, 250); avg_np = 6.4e-05. Boosting bin refine factor - should lead to better performance
xmin = 1.033422 xmax=998.203714 rpmax = 4.000000
In gridlink_index_particles_double> Running with [nmesh_x, nmesh_y, nmesh_z] = 300,300,250. Time taken = 4.522 sec
0%.........10%.........20%.........30%.........40%.........50%.........60%.........70%.........80%.........90%.........100% done. Time taken = 5.199 secs
General information
Issue description
Automatic grid refinement is accidentally triggered due to an
int8
overflow inmax_nmesh
(e.g. from here: https://github.com/manodeep/Corrfunc/blob/master/theory/DD/countpairs_impl.c.src#L244)We're taking the max of three
int
s and assigning the result to anint8
. Obviously the grid refinement needs an overhaul anyway, but in the meantime we can squash this bug.Expected behavior
Grid refinement is only triggered for
max_nmesh < BOOST_CELL_THRESH
(=10) oravg_np >= BOOST_NUMPART_THRESH
(=25)Minimal failing example