Topic: Iterative solver are too slow, parallel tests take forever
Trying to run through the test suite for parallel problems takes forever.
At first, I thought these tests where simply to large (brazil_2d_nl4 taking over 10 minutes to finish on my computer), but as the input files reveal, there isn't really that many elements (perhaps a bit on the large side).
Changing from a KSP-solver to a direct solver (LU factorization), using the Spooles library (through PETSc) reduced the execution time from 25 minutes to 5 seconds. 300 times speedup.
(flags used: -ksp_type preonly -pc_type lu -pc_factor_mat_solver_package spooles).
Some choices here;
1. Just make the use a direct solver by default. Any direct solver should work, but PETSc doesn't include one by default, so it has to be specified. Tests will fail for anyone who doesn't have the library compiled with PETSc.
2. Make the code choose a suitable linear solver automatically (say, Cholmod if its symmetric and positive definite problem, Spooles if its not, and in worst case, some built-in KSP solver). So it'll be fast for anyone who compiled PETSc with some suitable libraries.
3. Make the tests smaller to the point where they are fast even with a really slow KSP-solver. However, even the very tiny "4test" takes 4 seconds so this might not be a good plan.
As a side note, I'd like to make a statement regarding the test suite:
The test suite should only contain minimum necessary to make sure its running correctly. This usually means 1-10 elements in 1-2 time steps and hopefully results in < 0.5 seconds execution time.
Any longer would discourage developers from running the test suite, rather than making it a habit.
We can introduce another for benchmark problems if necessary, where I would have.