From: Salazar De T. M. <sal...@ll...> - 2017-11-11 21:14:19
|
Hello I have an optimization problem for which at a certain iteration, PETSc fails to build the preconditioner. I would like to catch that error and print my EquationSystem to disk so I can rerun the PETSc solve at that optimization iteration from the start. I cannot just rerun my optimization and write to disk at the iteration I know it is going to fail. The reason is that in parallel the optimization slightly differs every time I run it so the iteration it is going to fail at keeps changing. Maybe something along this lines: try{ system.solve() } catch(...){ EquationSystem & es = system.get_equation_systems(); es.write("eq_output.xdr") } Thanks Miguel |