ORNL / ReSolve

Library of GPU-resident linear solvers
Other
54 stars 2 forks source link

new user #165

Closed stonecoldhughes closed 2 weeks ago

stonecoldhughes commented 3 months ago

we are looking at using ReSolve for our HPC application, and I think this example code illustrates a lot of what we are trying to do. I had a question about this particular line in this test:

https://github.com/ORNL/ReSolve/blob/a92074f7c6bf66d99868781e5b6f821e83a576b6/examples/r_SysSolverCuda.cpp#L81

I see that the main loop here iterates over "numSystems" and that the input is coming from a family of matrices named this way:

https://github.com/ORNL/ReSolve/blob/a92074f7c6bf66d99868781e5b6f821e83a576b6/examples/r_SysSolverCuda.cpp#L61

At a high level, what is this test doing? How do the indices of "numSystems" determine when a matrix is updated and refactorized? Thank you!

stonecoldhughes commented 3 months ago

also, I see that the matrix is being read in from files:

https://github.com/ORNL/ReSolve/blob/a92074f7c6bf66d99868781e5b6f821e83a576b6/examples/r_SysSolverCuda.cpp#L82

are there some examples of constructing the matrix at runtime and then feeding it into this workflow the same way? Thank you!

pelesh commented 3 months ago

Thanks for your questions, @stonecoldhughes. The examples are designed so they emulate a nonlinear solver (dynamic, steady state, optimization, etc.). You can feed any series of linear systems generated during nonlinear solver operation and then test Re::Solve's performance on those systems before actually interfacing Re::Solve with the nonlinear solver.

In our tests, we use linear systems generated during alternating current optimal power flow analysis (ACOPF) for different power grid models available from here: https://github.com/NREL/opf_matrices

You would need to write a script that generates inputs (file names of matrices and right-hand-side vectors) for your test case. An example script runResolve is in the repository.

pelesh commented 3 months ago

are there some examples of constructing the matrix at runtime and then feeding it into this workflow the same way? Thank you!

You would need to instrument an existing nonlinear solver and dump linear systems to files as it runs. Some explanations how to do that are available at https://github.com/NREL/opf_matrices

pelesh commented 3 months ago

You may want to take a look at functionality tests first because they come with their own matrices.

pelesh commented 2 weeks ago

Closing it as there is no follow up action defined. Feel free to reopen, if needed.