final int forks = options.forks();
final VerboseMode verbMode = getVerboseMode(options);
final List<RunResult> results = new ArrayList<>();
final PrintWriter pw = new PrintWriter(STDOUT, true); // true means autoflush is on
final ResultFormat resultFormat = ResultFormatFactory.getInstance(ResultFormatType.TEXT, pw);
final long startNanos = System.nanoTime();
STDOUT.println("Starting benchmark runners...");
if (runEncoding) {
for (int K : Ks) {
final int F = deriveDataLength(K, T);
STDOUT.println("Running encoding benchmark for K = " + K);
Runner encRunner = newEncodingRunner(F, K, forks, verbMode);
results.addAll(encRunner.run());
}
}
if (runDecoding) {
for (int K : Ks) {
final int F = deriveDataLength(K, T);
for (int symbover : sos) {
STDOUT.println("Running decoding benchmark for K = " + K + " and symbol overhead = " + symbover);
Runner decRunner = newDecodingRunner(F, K, symbover, forks, verbMode);
results.addAll(decRunner.run());
}
}
}
final long ellapsed = System.nanoTime() - startNanos;
STDOUT.println("Done. Benchmark time: " + TimeUnit.NANOSECONDS.toSeconds(ellapsed) + "s");
STDOUT.println();
STDOUT.println("Benchmark results:");
resultFormat.writeOut(results);
pw.flush();
}
catch (ParameterException e) {
STDOUT.println(e.getMessage());
STDOUT.println();