sparse_dot icon indicating copy to clipboard operation
sparse_dot copied to clipboard

About the cg and mrhscg implementation

Open floatingCatty opened this issue 7 months ago • 3 comments

Dear Developers:

Hello!

Very glad to use such a convenient package to interface with MKL's vast number of methods.

I recently needed a preconditioned CG and mrhscg solver in my code development. I noticed that the repository here plans to include CG, but the code now seems not ready.

I am kindly asking for the development plan. I am also glad to contribute a few if needed.

Thanks!

Zhanghao

floatingCatty avatar May 06 '25 19:05 floatingCatty

The code to wrap the MKL routines exists and is fine - if you'd like to just use this to access the MKL functions from python that should not be a problem. There is a pythonic context manager for managing the iteration but that is not ready.

dgc_ and dfgmrhs_ are already present and adding the following dcgmrhs_ routines would only take a small amount of time.

dcgmrhs_init
dcgmrhs_check
dcgmrhs
dcgmrhs_get

Is there a specific preconditioner that you want?

asistradition avatar May 07 '25 20:05 asistradition

Wow, that is really good news!

Thanks for the efforts.

I want to use the algebraic multigrid preconditioner like boomamg from hypre. Is this possible?

Best,

Zhanghao

floatingCatty avatar May 08 '25 15:05 floatingCatty

Hi, I've gone through the code.

I think a pythonic routine that wraps the dcgmrhs like it is done in '/solvers/_cg.py' file would suit my need. I will also include a preconditioner. I will start coding a _dcgmrhs.py on my side, and will keep this updated if anything is done.

Your advice would be very appreciated, please feel free to comment.

Best,

Zhanghao

floatingCatty avatar May 15 '25 21:05 floatingCatty