Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6956 Discussions

Update FGMRes approximate solution during solution process

ata_mesgarnejad
968 Views

Hi,

I'm trying to see if there's a way to update the current approximate solution after each iteration for MKL FGMRes. This is to remove a know null-space from the approximate solution, much like it's done in PETSc. I'm not sure if/how can I access the approximate solution and pass it back to dfgmres? I also would like to ask why simply retrieving the solution with dfgmres_get with ipar(13)=1 (Fortran 1 based indexing), messes up the convergence?

 

I appreciate any help you can provide.

Ata

0 Kudos
1 Solution
Kirill_V_Intel
Employee
927 Views

Hello Ata,

I see you have two questions:

1) How to apply additional operation on the computed solution of FGMRES between iterations.

I suggest that you call dfgmres_get after any fgmres call at each iteration except the very first one, then apply your post-processing (removing the null space) to the returned by dfgmres_get vector, and then on the next iteration pass this to the next call dfgmres. I haven't tried it yet but I think this should work.

For more details about how to use FGMRES from MKL/oneMKL, you can look at the example fgmres_no_precon_c.c (although there fgmres_get is only called to get the final result).

2) Why simply retrieving the solution with dfgmres_get with ipar(13)=1 (Fortran 1 based indexing), messes up the convergence?

Could you provide more details about this? Ideally, a minimal reproducer. It would be much simpler to analyze the issue if it exists once we can run the suspicious case on our side. Have you noticed in the docs https://software.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-fortran/top/sparse-solver-routines/iterative-sparse-solvers-based-on-reverse-communication-interface-rci-iss/rci-iss-routines/dfgmres-get.html 
that the output array of fgmres_get is different based on ipar(13)=0 or > 0?

I hope this helps.

Best,
Kirill

View solution in original post

4 Replies
RahulV_intel
Moderator
949 Views

Hi,


Forwarding your question to the Subject Matter Experts. They will get back to you.


Regards,

Rahul


0 Kudos
Kirill_V_Intel
Employee
928 Views

Hello Ata,

I see you have two questions:

1) How to apply additional operation on the computed solution of FGMRES between iterations.

I suggest that you call dfgmres_get after any fgmres call at each iteration except the very first one, then apply your post-processing (removing the null space) to the returned by dfgmres_get vector, and then on the next iteration pass this to the next call dfgmres. I haven't tried it yet but I think this should work.

For more details about how to use FGMRES from MKL/oneMKL, you can look at the example fgmres_no_precon_c.c (although there fgmres_get is only called to get the final result).

2) Why simply retrieving the solution with dfgmres_get with ipar(13)=1 (Fortran 1 based indexing), messes up the convergence?

Could you provide more details about this? Ideally, a minimal reproducer. It would be much simpler to analyze the issue if it exists once we can run the suspicious case on our side. Have you noticed in the docs https://software.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-fortran/top/sparse-solver-routines/iterative-sparse-solvers-based-on-reverse-communication-interface-rci-iss/rci-iss-routines/dfgmres-get.html 
that the output array of fgmres_get is different based on ipar(13)=0 or > 0?

I hope this helps.

Best,
Kirill

ata_mesgarnejad
913 Views

Thank you, Kirill

With your help, I finally figured it out. For some reason, I need to read the solution in another vector and not the one I passed in the first iteration for the solution/initial guess. Then I remove its null-space and pass it back to dfgmres. 

 

Best,

Ata

0 Kudos
Gennady_F_Intel
Moderator
889 Views

thanks Kirill.

This issue has been resolved and we will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. 



0 Kudos
Reply