Skip to content

Conversation

@shakedregev
Copy link
Collaborator

@shakedregev shakedregev commented Sep 8, 2025

Description

The experimental examples currently go through CSC storage. This is unnecessary and complicates the code from the machine and user perspective.

This is required for #357. It more completely addresses #362, which I originally interpreted as the redone examples only.

Proposed changes

Reworked everything with setupCsr and getFactorsCsr.
Removed unnecessary usage of the Csc class.
Fixed some miscellaneous segfaults.
Simplified the logic for supplying the matrices and RHSs. There was some very weird and non-intuitive arithmetic going on there and I was not even sure how to call it.

This is how you call it currently, e.g. on pdesx for 3 systems:

./examples/experimental/klu_rf_fgmres_reuse_refactorization.exe /home/8zi/eng151/jacobian_residual_125/ScaleMicrogrid_Jacobian_N125_ /home/8zi/eng151/jacobian_residual_125/ScaleMicrogrid_Residual_N125_ 3
./examples/experimental/klu_cusolverrf_check_redo.exe /home/8zi/eng151/jacobian_residual_125/ScaleMicrogrid_Jacobian_N125_ /home/8zi/eng151/jacobian_residual_125/ScaleMicrogrid_Residual_N125_ 3
./examples/experimental/klu_glu_values_update.exe /home/8zi/eng151/jacobian_residual_125/ScaleMicrogrid_Jacobian_N125_ /home/8zi/eng151/jacobian_residual_125/ScaleMicrogrid_Residual_N125_ 3

On Frontier for 4 systems.:

./examples/experimental/klu_rocsolverrf_check_redo.exe /ccs/proj/eng151/jacobian_residual_2000/ScaleMicrogrid_Jacobian_N2000_ /ccs/proj/eng151/jacobian_residual_2000/ScaleMicrogrid_Residual_N2000_ 4

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.

  • 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.

Copy link
Collaborator Author

@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.

Resetting CLI.


ReSolve::LinSolverDirectKLU* KLU = new ReSolve::LinSolverDirectKLU;
ReSolve::LinSolverDirectCuSolverRf* Rf = new ReSolve::LinSolverDirectCuSolverRf;
ReSolve::LinSolverIterativeFGMRES* FGMRES = new ReSolve::LinSolverIterativeFGMRES(matrix_handler, vector_handler, GS);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure I understand why this is no longer using LinSolverIterativeFGMRES. Is it done under the hood? Should the file name be changed to reflect that we're testing something different?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. It must've been overzealous copy-pasting. It was unintentional.

@shakedregev shakedregev force-pushed the shaked/experimental_examples branch from d768d3c to 5570b99 Compare September 10, 2025 13:05
Copy link
Collaborator

@nkoukpaizan nkoukpaizan left a comment

Choose a reason for hiding this comment

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

Looks good to me. Tests pass on Frontier and pdesx.

While testing, I noticed some warnings on r_KLU_rocsolverrf_asym6x6 that I missed in my review for a previous PR. Addressing those in #374.

@shakedregev shakedregev merged commit 8020e40 into develop Sep 10, 2025
6 checks passed
@shakedregev shakedregev deleted the shaked/experimental_examples branch September 10, 2025 17:39
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