I use the solver library MUMPS via PETSc. Sometimes MUMPS fails due to
"error -9", which means that MUMPS allocated a workspace that wasn't big
enough. If you have MUMPS enabled, then you can reproduce this with
introduction_ex4 in libMesh as follows:

mpirun -np 4 ./example-opt -ksp_type preonly -pc_type lu
-pc_factor_mat_solver_package mumps -d 3 -n 20 -mat_mumps_icntl_14 1

I'd like to detect this failure and automatically re-run with different
solver args, e.g. if you re-run with "-mat_mumps_icntl_14 30" then it works
fine.

However, PetscLinearSolver currently doesn't support this, since we have:

ierr = KSPSolve (_ksp, rhs->vec(), solution->vec());
LIBMESH_CHKERRABORT(ierr);

With the introduction_ex4 example above, KSPSolve returns 76 (error in
external library, as shown here
<http://www.mcs.anl.gov/petsc/petsc-master/include/petscerror.h.html>) and
then LIBMESH_CHKERRABORT causes the program to abort.

I think it'd be good to make this easier to recover from, e.g. we could
throw an exception instead of calling LIBMESH_CHKERRABORT(ierr)? If others
agree that this is the right way to go, I can make a PR for this for the
PetscLinearSolver case (the same ideas would apply to PetscNonlinearSolver,
SlepcEigenSolver, etc, but good to start with the linear solver case).

David
------------------------------------------------------------------------------
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to