Open
Conversation
connorjward
reviewed
Jan 27, 2026
Contributor
connorjward
left a comment
There was a problem hiding this comment.
also adding @pytest.mark.timeout(300) for all our parallel tests
I recommend setting --timeout 300 --timeout-method thread for this (example).
| . venv-thetis/bin/activate | ||
| python -m pytest -n 8 --verbose --durations=0 thetis-repo/test_adjoint | ||
| if [ "${{ matrix.target }}" = "thetis" ]; then | ||
| mpiexec -n 2 python -m pytest --verbose --durations=0 --durations-min=60.0 \ |
Contributor
There was a problem hiding this comment.
You are losing a potential speedup of 4x here because there are 8 available cores on each runner. In Firedrake we use firedrake-run-split-tests to ensure utilisation (link).
Contributor
Author
|
Thanks for the comments @connorjward - I'll take a look in detail again soon and probably have some follow up questions! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #437. Closes #426.
Testing adjoint in (MPI) parallel:
For the MPI parallel adjoint tests, I have used the channel-optimisation example and copied the mesh across, because I couldn’t figure out how to add a subdomain to a
RectangleMesh. We could move this into a channel-optimisation directory if that’s cleaner, or alternatively switch to a simplified headland inversion example with regions defined asConstantcontrols. Either way, this requires a duplicate test. With the current example testing setup, we don’t have a way to select whether tests are run in serial or parallel. This could be updated so that along with each adjoint example, we specify whether it is serial or parallel, that would avoid the duplication.I've noticed that every now and again the Thetis MPI parallel tests hang and can take hours to complete, it might be worth also adding
@pytest.mark.timeout(300)for all our parallel tests. I don't think this is because of Thetis itself but just due to MPI collectives or repeated pytest-xdist collection hanging.Speeding up CI test suite:
It’s not possible to split matrix jobs on a single runner (as far as I can tell). I’ve implemented a matrix strategy that splits between runners, but we could revert to running everything on a single runner if preferred. Another option would be to merge the main and adjoint serial tests, although I prefer keeping them separate for clarity and cleaner outputs. If we stick with this then we need to update the tests that are required to pass for merging.