Skip to content

Benchmarking

williamlixu edited this page Aug 23, 2019 · 4 revisions

Benchmarking tools are now in the test package. There are 3 kinds of ways you can call the Runner to test the algorithm produces a valid schedule and time how long it takes.

Setup

Go to Runner class. Create an AlgorithmBenchmark variable. This should be passed an Algorithm which has a SolutionSpace. Example:

var benchmark = new AlgorithmBenchmark(() -> new NaiveBranchBoundAlgorithm(new AOSolutionSpace()));

Test package file

Load in a csv text file. Each line has the format: [filename],[number of nodes],[number of processors],[optimal solution].

var loader = new TestGraphLoader("/testPackages/random.txt");

These csvs live in resources/testPackages. There are ones for all the graphs with 2,4,8 and 16 processors with 10 nodes, as well as a few others (and you can make more).

Test any graph with conditions on the number of nodes/processors.

var loader = new TestGraphLoader(
                (nodes, procs) -> nodes <= 10 && procs <= 2,
                1);

Test any graph with conditions on the number of nodes/processors and the name matches a string.

You can add a commas separated string to the above to only get graphs that match the string.

var loader = new TestGraphLoader(
                (nodes, procs) -> nodes <= 10 && procs <= 2,
                1,
                "Fork_Join,Random");

This is also useful to run a specific graph:

var loader = new TestGraphLoader(
                (nodes, procs) -> true,
                1,
                "smol_boi");