Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
6434 Discussions

Update FGMRes approximate solution during solution process

mesgarnejad__ata
Beginner
360 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
319 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-fortra...
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
341 Views

Hi,


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


Regards,

Rahul


Kirill_V_Intel
Employee
320 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-fortra...
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

mesgarnejad__ata
Beginner
305 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

Gennady_F_Intel
Moderator
281 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. 



Reply