Skip to content

Commit

Permalink
Merge pull request #1517 from lattice/hotfix/mr_solver_convergence
Browse files Browse the repository at this point in the history
Update inv_mr_quda.cpp
  • Loading branch information
maddyscientist authored Nov 18, 2024
2 parents 6a01b5e + a2c2f5a commit 3ce35dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/inv_mr_quda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ namespace quda
mat(r, x);
r2 = blas::xmyNorm(b, r);
for (auto i = 0u; i < b2.size(); i++) param.true_res[i] = sqrt(r2[i] / b2[i]);
converged = (step < param.Nsteps && r2 < stop) ? true : false;
converged = (step > param.Nsteps || r2 < stop);
if (!converged) blas::copy(r_sloppy, r);
PrintStats("MR (restart)", iter, r2, b2);
} else {
blas::ax(scale, r_sloppy);
r2 = blas::norm2(r_sloppy);
converged = (step < param.Nsteps && r2 < stop) ? true : false;
converged = (step > param.Nsteps || r2 < stop);
if (!converged) blas::copy(r, r_sloppy);
}
step++;
Expand Down

0 comments on commit 3ce35dc

Please sign in to comment.