Skip to content

Conversation

@ASunil-17
Copy link
Collaborator

Description

The solution from the direct solve is treated as the initial guess. The iterative solvers are set up to compute an update. If the update plus the initial guess is offering a better estimation to the solution than the initial guess, then we return that quantity. If the initial residual is greater than the norm of the rhs, we assert that the initial guess is a poor choice.

_Closes # 376

_Mentions @shakedregev

Proposed changes

The changes have been implemented within the solve member of the class. During the pre-processing, we setup two new vectors vec_R_ and vec_Y_. The vector vec_R_ is the intial residual, whereas vec_Y_ contains our update (it is set to zero before the start of the FGMRES loop). These new vectors are essential replacing the rhs and the direct solution x from previous implementations. The main loop is largely the same, except we replace all references to x with vec_Y_ instead. After the loop we add the update to the initial guess, making sure to overwrite the update. The residual from this quantity is used to overwrite vec_R_. The norm of the new vec_R_ is computed and compared with the initial residual norm (saved during the pre-processing) and then the decision to overwrite x is made.

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask. We're here
to help! This is simply a reminder of what we are going to look for before
merging your code.

  • [ x] All tests pass. Code tested on
    • CPU backend
    • CUDA backend
    • HIP backend
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows Re::Solve style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining
why you chose the solution you did and what alternatives you considered, etc.

Copy link
Collaborator

@shakedregev shakedregev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase, follow ReSolve guidelines, and remove binary files.

@ASunil-17 ASunil-17 force-pushed the feature/cusolver-rf-config branch 2 times, most recently from b80efd6 to 430b5c1 Compare September 29, 2025 18:42
@shakedregev
Copy link
Collaborator

shakedregev commented Sep 29, 2025

This rebase is not correct.

  • The examples were modified for a reason, don't just write them back to what they were.
  • You left the binary files.
  • Please build out of source.

If you touched very few files, it probably makes the most sense to just make a new branch off develop and reapply those changes using this branch. I'm closing this PR so no one accidentally approves it. Start a new one on a new branch without all these unnecessary changes.

@ASunil-17
Copy link
Collaborator Author

Hello Shaked, apologies for not following the right steps. I will delete this branch and I will make a new branch off develop and apply the changes to the iterative methods.

@ASunil-17 ASunil-17 deleted the feature/cusolver-rf-config branch September 29, 2025 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants