wanlinksolve.cc 17.3 KB
Newer Older
1 2 3 4 5
/**** 
 wanlinksolve - 
 A Reasonably Effective Algorithm for Genetically Assigning Nodes.
 Chad Barb, May 3, 2002

6
 Applies a standard genetic algorithm (with crossover)
7 8 9 10 11 12 13 14 15
 to solve the problem of mapping a smaller "virtual" graph
 into a larger "physical" graph, such that the actual 
 weights between acquired nodes are similar to desired weights.

 The penalty function is the sum of error square roots.

 For the application this was designed for,
 "weights" are values of latency time in milliseconds.

Chad Barb's avatar
Chad Barb committed
16 17 18 19
 switches: 
   -v  Extra verbosity.

   -2 <weight>
20
       Solve for 2nd (bandwidth) dimension;
Chad Barb's avatar
Chad Barb committed
21 22 23 24 25
       Penalty for error is sum of differences of natural logs,
       multiplied by <weight>.
       A good weight seems to be around 7, but the appropriate
       value is pretty much application-dependent.

26 27 28
   -m <plexpenalty>
       Handle multiple virtual->physical mapping.
       For each vnode beyond 1 assigned to a pnode, <plexpenalty> will be assessed.
29 30 31
       Asks for 'p' lines of input, with the maximum number of virtual
       nodes allowed on a given physical node, per line (See below)

32 33 34
   -s <seed>
       Use a specific random seed.

Chad Barb's avatar
Chad Barb committed
35 36 37 38 39 40 41 42 43 44
   -r <minrounds>
       Specify the minimum number of rounds to go before stopping.
       Note that the algorithm won't actually stop until
       round 3n, where "n" is the round which found the best solution so far,
       or if it hits maxrounds.
       default: DEFAULT_ROUNDS

   -R <maxrounds>
       Specify the absolute maximum number of rounds.
       default: -1 (infinite)
45 46 47 48 49 50 51

 takes input from stdin, outputs to stdout.

 input format:

 * One line containing a single number 'p'-- the number of physical nodes.
 * 'p' lines containing the name of each physical node
52 53
 ? 'p' lines containing the maximum number of virtual nodes each 
       physical node can accommodate. ('-m' switch only)
54 55 56
 * 'p' lines each containing 'p' space-delimited numbers;
       this is a P x P matrix of the _actual_ weight from pnodes to 
       pnodes. For latencies, there are zeros along the diagonal.
Chad Barb's avatar
Chad Barb committed
57 58
 ? 'p' lines, a P x P matrix of actual bandwidth ('-2' switch only)

59 60

 * One line containing a single number 'v'-- the number of virtual nodes.
61 62 63
 * 'v' lines containing the name of each virtual node.
       If the name is prefaced with '*', then this node will be permanently
       mapped ("fix"ed) to the physical node of the same name. 
64 65 66 67 68 69
 * 'v' lines each containing 'v' space delimited numbers;
       this is a V x V matrix of the _desired_ weight between vnodes.
       '-1's indicate "don't care"s.. (e.g. for the weight between two
       not-connected vnodes.) 
       If link weights are symmetrical, this matrix will be its own
       transpose (symmetric over the diagonal.)
Chad Barb's avatar
Chad Barb committed
70
 ? 'v' lines, a V x V matrix of desired bandwidth ('-2' switch only)
71 72 73 74

 output format:
 
 Easily inferred. Note that the perl regexp:
75
 /(\S+)\smapsTo\s(\S+)/
76 77 78 79 80 81
 will grab vnode to pnode mappings (in $1 and $2, respectively.)
 
****/

#include <stdio.h>
#include <stdlib.h>
Chad Barb's avatar
Chad Barb committed
82 83
#include <stdarg.h>
#include <unistd.h>
84 85 86 87 88 89 90
#include <math.h>

// To keep things lightweight, 
// structures are statically sized to
// accommodate up to MAX_NODES nodes.
// These could be changed to STL vectors in the future.
#define MAX_NODES 20
Chad Barb's avatar
Chad Barb committed
91 92 93
#define MAX_DIMENSIONS 2

#define DEFAULT_ROUNDS 160
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125

// The size of our "population."
// (100,000 seems to work well.)
#define SOLUTIONS 100000

// The number of new children to produce each round.
// (20,000 seems to work well.)
#define CHILDREN_PER_ROUND 20000

// The probability a given child will NOT have a mutation.
// (out of 1000). 990 means 1% of children will mutate.
// (.01% will mutate twice, .0001% three times, etc.)
// 500 means 50% of children will mutate (25% twice, 12% three times, etc.)
// 500, incidentally, seems to be optimal.
#define MUTATE_PROB 500

// A score below Epsilon means we've found a perfect solution,
// so stop immediately.
#define EPSILON 0.0001f

// lets STL it up a notch.
#include <map>
#include <string>

// BAM!
using namespace std;

// keep freebsd from mumbling about gets(3) being unsafe.
#define gets( x ) fgets( x, sizeof( x ), stdin  )

// keep track of user names for nodes.
static map< int, string > pnodeNames;
126
static map< string, int > reversePNodeNames;
127 128 129 130
static map< int, string > vnodeNames;

static int pnodes, vnodes;

Chad Barb's avatar
Chad Barb committed
131 132 133
static int pLatency[MAX_DIMENSIONS][MAX_NODES][MAX_NODES];
static int vDesiredLatency[MAX_DIMENSIONS][MAX_NODES][MAX_NODES];

134
static float plexPenalty = 0.0f;
135 136 137 138 139
static int maxplex[MAX_NODES];
static int userSpecifiedMultiplex = 0;

static int fixed[MAX_NODES];

Chad Barb's avatar
Chad Barb committed
140 141 142 143 144 145
static int dimensions;
static float d2weight;

static int verbose = 0;

static int minrounds, maxrounds;
146 147 148 149

class Solution
{
public:
150
  int vnode_mapping[MAX_NODES];
151 152 153 154 155 156

  // Keep around a list of how many times each physical node is used
  // in this solution, rather than recomputing it each time it is needed
  // (which is often.)
  unsigned char pnode_uses[MAX_NODES];

157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
  float error;
};

static Solution pool[SOLUTIONS];

static inline int pickABest()
{
  // a hacky (but damn fast) probibility curve to
  // favor mating better solutions.

  switch (rand() % 4) {
  case 0: return rand() % (SOLUTIONS / 32);
  case 1: return rand() % (SOLUTIONS / 16);
  case 2: return rand() % (SOLUTIONS / 4);
  case 3: return rand() % (SOLUTIONS / 2);
172
  default: return 0; // can't happen, but -Wall doesn't realize this.
173 174 175 176 177 178 179 180
  }
}

static inline int pickAWorst()
{
  return SOLUTIONS - pickABest();
}

181
// uses a template to avoid massive numbers
182 183 184 185 186 187 188 189 190 191 192
// of "if" choices.. compiler should generate two versions,
// one with dump and one without.
template <bool verbose>
static inline void calcError( Solution * t )
{ 
  float err = 0.0f;

  if (verbose) {
    printf("Error listing:\n");
  }

193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
  if (userSpecifiedMultiplex) {
    for (int x = 0; x < pnodes; x++) {
      if (t->pnode_uses[x] > 1) { 
	float errDelta = (float)(t->pnode_uses[x] - 1) * plexPenalty;
	if (verbose) {
	  printf("%i nodes multiplexed on physical node %s, (err [(vnodes - 1) * plexPenalty] %4.3f)\n",
		 t->pnode_uses[x],
		 pnodeNames[x].c_str(),
		 errDelta );
	}
	err += errDelta;
      }
    }
  }

208
  {
Chad Barb's avatar
Chad Barb committed
209 210 211 212 213
    for (int z = 0; z < dimensions; z++) {
      for (int x = 0; x < vnodes; x++) {
	for (int y = 0; y < vnodes; y++) {
	  int should = vDesiredLatency[z][x][y];
	  if (should != -1) {
214
	    int is     = pLatency[z][ t->vnode_mapping[x] ][ t->vnode_mapping[y] ];
Chad Barb's avatar
Chad Barb committed
215 216 217 218 219 220 221
	    if (should != is) { 
	      float errDelta;

	      if (z == 0) {
		errDelta = sqrtf((float)(abs(should - is)));
	      } else {
		errDelta = d2weight * (float)(abs(should - is));
222
		if (should < is) { errDelta *= 0.5f; }
Chad Barb's avatar
Chad Barb committed
223 224 225 226 227 228 229 230
	      }

	      if (verbose) {
		if (z == 0) {
		  printf("%s -> %s latency (ms) should be %i; is %i (err [sqrt |a-b|] %4.3f)\n", 
			 vnodeNames[x].c_str(), vnodeNames[y].c_str(), 
			 should, is, errDelta );
		} else {
231
		  printf("%s -> %s bandwidth (kB/s) should be ~%i; is ~%i (err [wt %s* ln (a/b)] %4.3f)\n", 
Chad Barb's avatar
Chad Barb committed
232 233 234
			 vnodeNames[x].c_str(), vnodeNames[y].c_str(), 
			 (int)expf((float)should / 1000.0f), 
			 (int)expf((float)is / 1000.0f),
235
			 (should < is) ? "* 0.5 " : "",
Chad Barb's avatar
Chad Barb committed
236 237 238 239
			 errDelta );
		}
	      }
	      err += errDelta;
240 241 242 243 244 245 246
	    }
	  }
	}
      }
    }
  }

Chad Barb's avatar
Chad Barb committed
247
  if (verbose) { printf("error of %4.3f\n", err ); }
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
  t->error = err;
} 

static int compar( const void * a , const void * b )
{
  Solution * sa = (Solution *)a;
  Solution * sb = (Solution *)b;

  if (sa->error > sb->error) { return  1; } else
  if (sa->error < sb->error) { return -1; } else
  { return 0; }
}

static inline void sortByError()
{
  // Ahh.. sweet, sweet qsort.
  qsort( pool, SOLUTIONS, sizeof( Solution ), compar );
}

// "Mutating" is swapping what vnode a pnode maps to in
// the solution with what vnode a different pnode maps to.
// (if both are -1, e.g. not mapped to vnodes, nothing happens.)
static inline void mutate( Solution * t )
{
  while(1) {
    // forecast calls for a 1% chance of mutation...
    if ((rand() % 1000) < MUTATE_PROB) { break; }
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
    
    if ((rand() % 3)) {
      // swap mutation. 
      int a, b;
      do {
	a = rand() % vnodes;
	b = rand() % vnodes;
      } while (fixed[a] != -1 || fixed[b] != -1);
      int temp = t->vnode_mapping[a];
      t->vnode_mapping[a] = t->vnode_mapping[b];
      t->vnode_mapping[b] = temp;
    } else {
      // reassign mutation
      /*
      int pnode_uses[MAX_NODES];

      bzero( pnode_uses, sizeof( pnode_uses ) );

      for (int i = 0; i < vnodes; i++) {
	++pnode_uses[ t->vnode_mapping[i] ];
      }
      */

      int a, b;
      // find which vnode to remap
      do {
	a = rand() % vnodes;
      } while (fixed[a] != -1);

      // de-map it.
      --t->pnode_uses[ t->vnode_mapping[a] ];

      // now find a suitable physical node.
      do {
	b = rand() % pnodes;
      } while (t->pnode_uses[b] >= maxplex[b]);

      // now map it.
      t->vnode_mapping[a] = b;
      ++t->pnode_uses[b];
    }
316 317 318 319 320 321 322 323
  }
}

// TODO: make sure that failed matings don't happen too
// often for difficult graphs.
// (perhaps have a limited retry)
static inline void splice( Solution * t, Solution * a, Solution * b)
{
324 325 326
  // temp storage so we don't clobber t unless the child turns out to be
  // cromulent.
  int vnode_mapping_t[MAX_NODES]; 
327
  int pnode_uses_t[MAX_NODES];
328

329
  bzero( pnode_uses_t, sizeof( pnode_uses_t ) );
330 331 332 333

  for (int i = 0; i < vnodes; i++) {
    if (fixed[i] != -1) {
      vnode_mapping_t[i] = fixed[i];
334
      ++pnode_uses_t[ fixed[i] ];
335 336 337 338 339 340 341 342 343 344 345 346 347 348
    }
  }

  // go through each mapping, and pick randomly
  // which one of the two parents' mappings the child
  // will inherit.
  // Inherit the one that makes sense if the other would
  // conflict with a previously chosen mapping.
  // If both would conflict with a previously chosen mapping.
  // its a failed mating, and we return.

  int pos = rand() % vnodes;
  for (int i = 0; i < vnodes; i++) {
    pos = (pos + 1) % vnodes;
349
    if (fixed[pos] != -1) continue;
350
    if (rand() % 2) {
351
      if (pnode_uses_t[ a->vnode_mapping[pos] ] < maxplex[ a->vnode_mapping[pos] ]) {
352
	vnode_mapping_t[pos] = a->vnode_mapping[pos];
353
	++pnode_uses_t[ a->vnode_mapping[pos] ];
354
      } else {
355
	if (pnode_uses_t[ b->vnode_mapping[pos] ] < maxplex[ b->vnode_mapping[pos] ]) {
356
	  vnode_mapping_t[pos] = b->vnode_mapping[pos];
357
	  ++pnode_uses_t[ b->vnode_mapping[pos] ];
358 359 360 361 362 363
	} else {
	  // failed mating.
	  return;
	}
      }
    } else {
364
      if (pnode_uses_t[ b->vnode_mapping[pos] ] < maxplex[ b->vnode_mapping[pos] ]) {
365
	vnode_mapping_t[pos] = b->vnode_mapping[pos];
366
	++pnode_uses_t[ b->vnode_mapping[pos] ];
367
      } else {
368
	if (pnode_uses_t[ a->vnode_mapping[pos] ] < maxplex[ a->vnode_mapping[pos] ]) {
369
	  vnode_mapping_t[pos] = a->vnode_mapping[pos];
370
	  ++pnode_uses_t[ a->vnode_mapping[pos] ];
371 372 373 374 375 376 377 378
	} else {
	  // failed mating.
	  return;
	}
      }
    }
  }

379 380
  // ok.. good one..
  // since we have a cromulent child, we now clobber t.
381
  for(int d = 0; d < vnodes; d++) {
382 383 384 385 386
    t->vnode_mapping[d] = vnode_mapping_t[d];
  }

  for(int e = 0; e < pnodes; e++) {
    t->pnode_uses[e] = pnode_uses_t[e];
387 388 389 390 391 392 393 394 395 396 397 398
  }

  // Mazeltov!

  mutate( t );
  calcError<false>( t );  
} 

// Generate a random solution 
// for the initial population.
static inline void generateRandomSolution( Solution * t )
{
399 400
  //int pnode_uses[MAX_NODES];
  bzero( t->pnode_uses, sizeof( t->pnode_uses ) );
401 402 403 404

  for (int i = 0; i < vnodes; i++) {
    if (fixed[i] != -1) {
      t->vnode_mapping[i] = fixed[i];
405
      ++t->pnode_uses[ fixed[i] ];
406 407
    }
  }
408 409 410 411 412 413

  for (int i = 0; i < vnodes; i++) {
    if (fixed[i] == -1) {
      int x;
      do {
	x = rand() % pnodes;
414 415
      } while( t->pnode_uses[x] >= maxplex[x] );
      ++t->pnode_uses[x];
416 417 418 419
      t->vnode_mapping[i] = x;
    }
  }

420 421 422
  calcError<false>( t );
}

Chad Barb's avatar
Chad Barb committed
423
void usage( char * appname )
424
{
Chad Barb's avatar
Chad Barb committed
425 426 427 428
  fprintf(stderr,
	  "Usage:\n"
	  "%s [-v] [-2 <weight>] [-r <minrounds>] [-R <maxrounds>]\n\n"
	  "  -v              extra verbosity\n"
429 430
	  "  -m <penalty>    enable many-to-one virtual to physical mappings\n"
	  "  -s <seed>       seed the random number generator with a specific value\n"
Chad Barb's avatar
Chad Barb committed
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
	  "  -2 <weight>     enable solving for bandwidth;\n"
	  "                  multiply bandwidth penalties by <weight>.\n"
	  "  -r <minrounds>  set minimum rounds (a.k.a. generations)\n"
	  "                  default: %i\n"
	  "  -R <maxrounds>  set maximum rounds\n"
	  "                  default: infinite (-1)\n\n", appname, DEFAULT_ROUNDS );
  exit(-2);
}

int main( int argc, char ** argv )
{
  verbose = 0;
  dimensions = 1;
  d2weight = 1.0f / 1000.0f;

  minrounds = DEFAULT_ROUNDS;
  maxrounds = -1;

  int ch;

451
  while ((ch = getopt(argc, argv, "v2:r:R:s:m:")) != -1) {
Chad Barb's avatar
Chad Barb committed
452
    switch (ch) {
453 454 455
    case 's':
      srand( atoi( optarg ) );
      break;
Chad Barb's avatar
Chad Barb committed
456 457 458
    case 'v': 
      verbose++; 
      break;
459
    case 'm':
460
      plexPenalty = atof( optarg );
461 462
      userSpecifiedMultiplex++;
      break;
Chad Barb's avatar
Chad Barb committed
463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478
    case '2': 
      dimensions = 2;
      d2weight = atof( optarg ) / 1000.0f; 
      break;
    case 'r':
      minrounds = atoi( optarg );
      break;
    case 'R':
      maxrounds = atoi( optarg );
      break;
    default: 
      usage( argv[0] );
    }
  }


479 480 481
  char line[1024];

  {
Chad Barb's avatar
Chad Barb committed
482
    if (verbose) { printf("How many physical nodes?\n"); }
483 484 485
    gets( line );
    sscanf( line, "%i", &pnodes );

Chad Barb's avatar
Chad Barb committed
486
    if (verbose) { printf("Okay, enter %i names for the physical nodes, one per line.\n", pnodes ); }
487 488 489 490 491
    for (int i = 0; i < pnodes; i++) {
      char name[1024];
      gets( line );
      sscanf( line, "%s", name );
      pnodeNames[i] = string( name );
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506
      reversePNodeNames[string(name)] = i;
    }

    if (userSpecifiedMultiplex) {
      if (verbose) { printf("Enter %i numbers, one per line, indicating the"
			    " maximum number of virtual nodes allowed on each"
			    " physical node.\n", pnodes ); }
      for (int i = 0; i < pnodes; i++) {
	gets( line );
	sscanf( line, "%i", &(maxplex[i]));
      }
    } else {
      for (int i = 0; i < pnodes; i++) {
	maxplex[i] = 1;
      }
507 508
    }

Chad Barb's avatar
Chad Barb committed
509 510 511 512 513 514 515 516 517 518 519 520 521 522 523
    for (int z = 0; z < dimensions; z++) {
      if (verbose) {
	printf("Enter %ix%i grid o' actual %s.\n", pnodes, pnodes, 
	     (z == 0) ? "latency" : "bandwidth");
      }
      for (int y = 0; y < pnodes; y++) {
	char * linePos = line;
	gets( line );
	while (*linePos == ' ') { linePos++; } // skip leading whitespace
	for (int x = 0; x < pnodes; x++) {
	  sscanf( linePos, "%i", &pLatency[z][x][y] );
	  if (z == 1) { pLatency[z][x][y] = (int)( logf(pLatency[z][x][y]) * 1000.0f ); }
	  while (*linePos != ' ' && *linePos != '\n') { linePos++; }
	  while (*linePos == ' ') { linePos++; }
	}
524 525 526 527 528
      }
    }
  } 

  {
Chad Barb's avatar
Chad Barb committed
529
    if (verbose) { printf("How many virtual nodes?\n"); }
530 531 532
    gets( line );
    sscanf( line, "%i", &vnodes );

533 534
    if (verbose) { printf("Okay, enter %i names for the virtual nodes, one per line.\n"
			  "(Preface name with '*' to fix assignment to pnode of the same name.\n", vnodes ); }
535 536
    for (int i = 0; i < vnodes; i++) {
      char name[1024];
537
      char *namep = name;
538 539
      gets( line );
      sscanf( line, "%s", name );
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554
      if (namep[0] == '*') {
	namep++;
	map< string, int >::iterator it = reversePNodeNames.find( string( namep ) );
	if (it == reversePNodeNames.end()) {
	  fprintf(stderr,"vnode '%s' does not match any pnode; can't fix.\n", namep );
	  exit(-1);
	}
	if (verbose) { 
	  printf("Fixing assignment from vnode %s to pnode %s.\n", namep, namep );
	}
	fixed[i] = reversePNodeNames[ string( namep ) ];
      } else {
	fixed[i] = -1;
      }
      vnodeNames[i] = string( namep );
555 556
    }

Chad Barb's avatar
Chad Barb committed
557 558 559 560
    for (int z = 0; z < dimensions; z++) {
      if (verbose) {
	printf("Enter %ix%i grid o' desired %s (-1 is don't care.)\n", vnodes, vnodes, 
	       (z == 0) ? "latency" : "bandwidth");
561
      }
Chad Barb's avatar
Chad Barb committed
562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578
      for (int y = 0; y < vnodes; y++) {
	char * linePos = line;
	gets( line );
	while (*linePos == ' ') { linePos++; } // skip leading whitespace
	for (int x = 0; x < vnodes; x++) {
	  sscanf( linePos, "%i", &vDesiredLatency[z][x][y] );
	  if (z == 1) { 
	    if (vDesiredLatency[z][x][y] != -1) {
	      vDesiredLatency[z][x][y] = (int)(logf(vDesiredLatency[z][x][y]) * 1000.0f); 
	    }
	  }
	  while (*linePos != ' ' && *linePos != '\n') { linePos++; }
	  while (*linePos == ' ') { linePos++; }
	}
      }
    } 
  }
579

Chad Barb's avatar
Chad Barb committed
580
  if (verbose) { printf("Thanks.. now running...\n"); }
581 582 583 584 585 586 587 588 589 590 591

  {
    for (int i = 0; i < SOLUTIONS; i++) {
      generateRandomSolution( &(pool[i]) );
    }
    sortByError();
  }

  {
    int highestFoundRound = 0;
    float last = pool[0].error;
Chad Barb's avatar
Chad Barb committed
592 593
    for (int i = 0; i != maxrounds && (i < minrounds || i < highestFoundRound * 3); i++) {
      if (verbose && !(i % (minrounds / 10))) {
594 595 596 597
	printf("Round %i. (best %4.3f)\n", i, pool[0].error);
      }

      if (pool[0].error < last) {
Chad Barb's avatar
Chad Barb committed
598 599
	if (verbose) {
	  printf("Better solution found in round %i (error %4.3f)\n", 
600
	       i, pool[0].error);
Chad Barb's avatar
Chad Barb committed
601
	}
602 603 604 605 606 607 608 609 610 611 612 613
	last = pool[0].error;
	highestFoundRound = i;
      }

      for (int j = 0; j < CHILDREN_PER_ROUND; j++) {
	// Overwrite a "bad" solution with the child of two "good" ones.
	splice( &(pool[pickAWorst()]), 
		&(pool[pickABest()]), 
		&(pool[pickABest()]) ); 
      }
      sortByError();
      if (pool[0].error < EPSILON) { 
Chad Barb's avatar
Chad Barb committed
614
	if (verbose) { printf("Found perfect solution.\n"); }
615 616 617 618 619 620
	break;
      }
    }
  }

  {
Chad Barb's avatar
Chad Barb committed
621
    if (verbose) { printf("\nYour solution is as follows:\n"); }
622
    for (int x = 0; x < vnodes; x++) {
Chad Barb's avatar
Chad Barb committed
623 624 625 626 627 628
      if (pnodeNames.find( pool[0].vnode_mapping[x] ) == pnodeNames.end()) {
	pnodeNames[ pool[0].vnode_mapping[x] ] = "CRAP";
      }
      printf("%s mapsTo %s\n", 
	     vnodeNames[x].c_str(),
	     pnodeNames[pool[0].vnode_mapping[x]].c_str() );
629
    }
630

631 632 633
    printf("\n");

    // dump a detailed report of the returned solution's errors.
Chad Barb's avatar
Chad Barb committed
634
    if (verbose) { calcError<true>( &(pool[0]) ); }
635 636
  }

Chad Barb's avatar
Chad Barb committed
637
  if (verbose) { printf("Bye now.\n"); }
638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653
  return 0;
}