When symbolically factoring an AIJ matrix, PETSc has to guess
how much fill there will be. Careful use of the fill parameter in the
MatILUInfo structure
when calling MatLUFactorSymbolic() or MatILUFactorSymbolic()
can reduce greatly the number of mallocs and copies required, and thus
greatly improve the performance of the factorization. One way to
determine a good value for f is to run a program with the option -log_info.
The symbolic factorization phase will then print information such as
Info:MatILUFactorSymbolic_AIJ:Realloc 12 Fill ratio:given 1 needed 2.16423This indicates that the user should have used a fill estimate factor of about 2.17 (instead of 1) to prevent the 12 required mallocs and copies. The command line option
-pc_ilu_fill 2.17will cause PETSc to preallocate the correct amount of space for incomplete (ILU) factorization. The corresponding option for direct (LU) factorization is -pc_lu_fill <fill_amount>.