static void iterate(void);
static void iterate_recurse(int i, AdjWord min);
+static bool preconsider_ok(int nwords, bool doprint);
+static bool maxhamweight_ok(void);
static void optimise(bool doprint);
static void progress_eol(void) {
} Worker;
static Worker *mc_us;
+static void multicore_check_for_new_best(void);
+
#define MAX_NIOVS 3
static AdjWord mc_iter_min;
static int mc_niovs;
ssize_t r = readv(mc_work[0], mc_iov, mc_niovs);
if (r == 0) break;
assert(r == mc_iovlen);
+
+ bool ok = maxhamweight_ok();
+ if (!ok) continue;
+
+ ok = preconsider_ok(multicore_iteration_boundary, 1);
+ progress_eol();
+ if (!ok) continue;
/* stop iterate_recurse from trying to run multicore_outer_iteration */
int mc_org_it_bound = multicore_iteration_boundary;
static int totalfrags;
+static bool maxhamweight_ok(void) {
+ double maxminsize = (double)m / maxhamweight;
+ return maxminsize > best;
+}
+
static bool preconsider_ok(int nwords, bool doprint) {
int i;
static void iterate(void) {
for (maxhamweight=1; maxhamweight<=m; maxhamweight++) {
- double maxminsize = (double)m / maxhamweight;
- if (maxminsize <= best)
+ if (!maxhamweight_ok())
continue;
iterate_recurse(0, 1);