speed up tests - #5331
Conversation
|
I have been working towards faster codegen for sum-factorization. Maybe there's no need to chop the degree on some of these tests |
| ids=["Rectangle", "Box"]) | ||
| def mesh(request): | ||
| nx = 4 | ||
| nx = 2 |
There was a problem hiding this comment.
I had nx = 4 for a good reason. With nx=2 every cell touches the boundary.
There was a problem hiding this comment.
So nx=3 is fine?
There was a problem hiding this comment.
I think if the test is slow even for nx=4, it means that we are setting the wrong solver options. The whole point of the FDM stuff is to ensure a very sparse operator, so I'd rather dig into the root of the problem and strengthen this test instead of just tweaking the mesh size.
Almost every test in this module uses the mesh fixture. I think only a few tests that rely on mumps are compute-dominated, and I think those can be speed up by tweaking mumps options, perhaps by changing mat_ordering_type.
| import os | ||
| if os.getenv("FIREDRAKE_CI") == "1": | ||
| mesh = ExtrudedMesh(UnitSquareMesh(2, 2, quadrilateral=True), 2) | ||
| else: | ||
| mesh = ExtrudedMesh(UnitSquareMesh(10, 10, quadrilateral=True), 10) |
There was a problem hiding this comment.
The mesh size in the actual demo can become 2. The purpose of demo is just to measure flops
| import os | ||
| if os.getenv("FIREDRAKE_CI") == "1": | ||
| mesh = CubedSphereMesh(radius=R0, refinement_level=2, degree=3) | ||
| else: | ||
| mesh = CubedSphereMesh(radius=R0, refinement_level=4, degree=3) |
There was a problem hiding this comment.
We can just set the refinement_level inside the if-statement.
| ndump = 100 # frequency of file dumps | ||
| dumpn = 0 # dump counter | ||
| nsteps = 5000 | ||
| import os |
There was a problem hiding this comment.
It's surprising that one of our slowest demos is 1D.
There was a problem hiding this comment.
It's 2D (extruded) with a lot of timesteps.
There was a problem hiding this comment.
5,000 timesteps of a three-stage RK method with two solves in each stage will do that
There was a problem hiding this comment.
Yeah. The splitting method has quite a small stability limit on the timestep.
| We are getting close to the time loop. We set up some timestepping | ||
| parameters. :: | ||
|
|
||
| T = 50.0 # maximum timestep |
There was a problem hiding this comment.
This is not accurate. The comment should say T = final time
|
|
||
| base = UnitSquareMesh(8, 8, quadrilateral=True) | ||
| mesh = ExtrudedMesh(base, 8) | ||
| # Setup for faster test execution. |
There was a problem hiding this comment.
This is polluting the demo.
- Can we just do it one place? Can there be only one branch (no else statement, just set the demo parameters before the if statment).
- Can we hide it so it does not appear in the html?
| coarse = { | ||
| "mat_type": "aij", | ||
| "ksp_type": "preonly", | ||
| "pc_type": "cholesky", |
There was a problem hiding this comment.
| "pc_type": "cholesky", | |
| "pc_factor_mat_solver_type": "mumps", |
| "pc_type": "python", | ||
| "pc_python_type": "firedrake.ASMExtrudedStarPC", | ||
| "pc_star_mat_ordering_type": "nd", | ||
| "pc_star_sub_sub_pc_type": "cholesky", |
There was a problem hiding this comment.
| "pc_star_sub_sub_pc_type": "cholesky", | |
| "pc_star_sub_sub_pc_factor_mat_solver_type": "cholmod", |
| "pc_type": "python", | ||
| "pc_python_type": "firedrake.ASMExtrudedStarPC", | ||
| "pc_star_mat_ordering_type": "nd", | ||
| "pc_star_sub_sub_pc_type": "cholesky", |
There was a problem hiding this comment.
| "pc_star_sub_sub_pc_type": "cholesky", | |
| "pc_star_sub_sub_pc_factor_mat_solver_type": "cholmod", |
No description provided.