-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed up unit tests by running ctest in parallel #784
Conversation
Did this actually make it faster than before? It looks like it still takes about the same amount of time, based on the timings I remember. |
This indeed makes the running process faster for the three checks I changed. There could be other checks that take the majority of the time but aren't optimized. I would also try to increase the number of parallelization in the build process to as high as possible. Currently most of them are 4. |
How much faster does it make it? Also, I don't think all of the virtual machines have 4 cores available. It might be good to check here: https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories and/or empirically test whether 2, 3 or 4 simultaneous tests is fastest. |
Another thing to test would be whether it's faster to run multiple test in parallel, or to just turn on MPI for the tests, so each test is itself parallelized. You can do that by adding
|
Although as long as we have documented somewhere how much faster this is than before, we can search for the optimal solution later. |
So, Windows and Linux has 4 cores and macOS has 3 cores. I've changed the parallelisation of the macOS tests from 2 to 3. |
Quality Gate passedIssues Measures |
I can do a benchmark, but it seems obvious to me that running ctest in parallel is faster than on a single core. I tested it on my own Mac Studio. It scales almost linear with the number of processes up to 8 cores.
If you have many (tens of) tests, which is the case here, since all the tests are independent, |
For the macOS test with |
You have to measure, not conjecture. GitHub actions runs on virtual machines that have multiple VMs running on the same machine. It is not necessarily the case that it will scale in the VM the same way as on your own machine.
Again, you must put on your engineering hat and measure the outcome, rather than conjecture as a theorist. It is not necessarily the case that running independent simulations will always be faster. It is possible that cache contention effects will make it slower. |
Description
Speed up CPU unit tests by running ctest on parallel, e.g.
ctest -j4
.Related issues
#783
Checklist
Before this pull request can be reviewed, all of these tasks should be completed. Denote completed tasks with an
x
inside the square brackets[ ]
in the Markdown source below:/azp run
.