Run a benchmarking suite and measure time taken by the solver.

    Each scenario is run in an isolated process, and results are appended to
    CSV file.

def benchmark():
    """ Run a benchmarking suite and measure time taken by the solver.

    Each scenario is run in an isolated process, and results are appended to
    CSV file.
    """
    # Use all cores but one on multi-core CPUs.
    pool_size = multiprocessing.cpu_count() - 1
    if pool_size < 1:
        pool_size = 1

    # Start a pool of workers. Only allow 1 task per child, to force flushing
    # of solver's internal caches.
    pool = multiprocessing.Pool(processes=pool_size, maxtasksperchild=1)
    results = pool.imap_unordered(run_scenario, Benchmark.scenarii)
    pool.close()
    pool.join()

    # Update CSV database with the new results.
    benchmark = Benchmark()
    benchmark.load_csv()
    benchmark.add(results)
    benchmark.save_csv()