Parallelization of MaxNorm in NewtonMethod
NewtonMethod calculates the current defect, i.e. the norm of the current residual, as
if (_useMaxNorm){
auto rankMax = Backend::native(_residual).infinity_norm();
_result.defect = _gridOperator.testGridFunctionSpace().gridView().comm().max(rankMax);
}
else
_result.defect = _linearSolver.norm(_residual);
This causes an issue if the residual in the overlap is not consistent across processors (which does not seem to be a requirement for NewtonMethod with ISTLBackend_BCGS_AMG_ILU0). Using the regular norm works, since _linearSolver.norm
uses disjointDot
, which masks the overlap from the scalar product. However, infinity_norm
includes the overlap, and therefore the max norm does not produce the correct result.
Is this the intended behaviour? Or should the residual that is produced by the grid operator anyway be consistent across processors, and this is an issue of my implementation? This could explain why e.g. ISTLBackend_OVLP_GMRES_ILU0 for me does not converge in parallel. On a related note, is the correct behaviour of residuals, Jacobians etc. in terms of consistency across processors, and the respective requirements of the different linear solvers, documented anywhere? I did not manage to find anything beyond the occasional comment in the code.