Seems to happen in multicore mode when the first worker reports a
near-zero value of 'best', and then set_best reduces it to a negative
number when it applies the rounding fudge, leading to the max_frags
limits being set to negative things and all other workers' results
being thrown away in preconsider_ok().
* subtract a fudge factor from our target.
*/
double near_best = best * 0.98 - 0.02;
- n_max_frags = ceil(n / near_best) - 1;
- m_max_frags = ceil(m / near_best) - 1;
+ if (near_best > 0) {
+ n_max_frags = ceil(n / near_best) - 1;
+ m_max_frags = ceil(m / near_best) - 1;
+ }
}
/*----- multicore support -----*/