Letβs assume a single test with 4 paths. Weβre going to represent how long it takes to solve a given path with squares: π© is fast, π©π©π© is slower, and so on
solver | path #1 | path #2 | path #3 | path #4 |
---|---|---|---|---|
z3 | π© | π©π© | π© | π©π©π© |
How long does this take to complete on a machine with 16 cores?
--solver-threads=1
, we have 1 core busy at 100% on the first path, then the second, and so on sequentially so the total time is π©π©π©π©π©π©π©--solver-threads=4
, we process all 4 paths in parallel. The first 3 paths complete quickly, but the halmos instance has to wait for the slowest one, so the total time is π©π©π©--solver-threads=16
, we still process all 4 paths in parallel, but each solver can only use one core at a time. So we donβt see any improvement over --solver-threads=4
, total time is still π©π©π©So the best we can do is π©π©π©, because thatβs how long it takes for z3 to process the hardest path using 1 core at 100%.
Or is it? What if we used other solvers? What if we ran 4 halmos instances, each using a different solver? Letβs say the results look like this:
solver | path #1 | path #2 | path #3 | path #4 | sequential time | parallel time |
---|---|---|---|---|---|---|
z3 | π© | π©π© | π© | π©π©π© | π©π©π©π©π©π©π© | π©π©π© |
spiky | π©π©π©π© | π© | π© | π© | π©π©π©π©π©π©π© | π©π©π©π© |
even | π©π© | π©π© | π©π© | π©π© | π©π©π©π©π©π©π©π© | π©π© |
fasty | π©π© | π© | π© | π© | π©π©π©π©π© | π©π© |
Some takeaways:
even
, it takes the same time to process each path. Itβs pretty terrible sequentially, but itβs great in parallel (i.e. with --solver-threads=4
)spiky
that is very fast on most queries but very slow on outliers. That makes its parallel performance very bad (since we need to wait on the slowest query)fasty
is basically fast on everything which is great sequentially, but it still doesnβt beat even in parallel performanceRunning all 4 halmos instances in parallel, our CPU usage over time would look like this:
| CPU usage
100% | πͺ πͺ πͺ πͺ | | | | | --- | --- | --- | --- | --- | | 75% | π¦ π¦ π¦ π¦ | | | | | 50% | π§ π§ π§ π§ | π¦ π¦ π¦ π¦ | | | | 25% | π© π© π© π© | πͺ π§ π© π© |
π§ π© |
π§ | | | time t = 1 | t = 2 | t = 3 | t = 4 |
legend: