- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Hi,

I have a sparse, structurally-symmetric matrix.
The solution of this matrix is part of a larger iterative solver, so the
matrix needs to be solved many times. The values in the matrix will
modestly change between iterations, but the sparsity pattern will remain the
same.

Based on my reading of the PARDISO documentation, it sounds
like this situation argues strongly for the implementation of the CGS iterative
scheme. It sounds
like PARDISO needs to be called once with *phase=11*, and then
subsequently called with *phase=23* and *iparm(4)=31*. Is this
correct? I havent been able to get this to work. I get the following errors:

*** Error in PARDISO ( numerical_factorization) error_num= -3

*** Error in PARDISO: cgs error iparam(20) -22

Are there any public examples that would be useful? Any other thoughts?

Are there any public examples that would be useful? Any other thoughts?

Thanks,

Greg

1 Solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

I've attached my modification of pardiso_unsym_c.c, its return correct output. Could you modificate it and attach here to reproduce your issue?

With best regards,

Alexander Kalinkin

Link Copied

10 Replies

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Am I right that you use mtype=1 or 3? Could you change it on 11 and 13 correspondantly and check the output? In any case could you send small testcase with compiling line to reproduce this issue on our side?

With best regards,

Alexander Kalinkin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Thanks for looking into this. You are correct that I was previously using mtype=1. Using mtype=11 appears to produce the same errors.

A test case is attached. I suspect that there may be something basic wrong with my input. Please let me know what you find.

Best Regards,

Greg

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

I've include your data ( values got from sparse_values(1) ) in example named pardiso_unsym_c in example folder and can't reproduce your issue :( Maybe there are some problems with rhs or other parameters that you didn't provide... Could you provide small example with errors you mentioned and send it to me?

With best regards,

Alexander Kalinkin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

I've re-attached the file to this posting, updated with the values of the RHS that I'm using. (The same RHS is used for each matrix.)

However, I suspect the problem I'm having is related to how I'm calling the subroutine. I have no problem using the "default"

*iparm*values to call PARDISO and obtain a solution to the matrices. That works just fine. When I try to use the CGS iteration (

*iparm(4)*=31 in Fortran,

*iparm[3]=31*in C) to replace the computation of LU is when I encounter problems.

Based on my reading of the documentation, my best guess as to how this is supposed to work is as follows (example in abbreviated Fortran):

do ...

sparse_values = ...

At what point in the pardiso_unsym_c are you modifying iparm(3)?

Thanks,

Greg

iteration = iteration + 1

sparse_values = ...

if(iteration == 1) then

phase=13

iparm(4) = 0

call pardiso(...)

phase=13

iparm(4) = 0

call pardiso(...)

else

phase=23

iparm(4)=31

call pardiso(...)

endif

enddo

When I attempt this, I get the following:

phase=23

iparm(4)=31

call pardiso(...)

endif

enddo

When I attempt this, I get the following:

Percentage of computed non-zeros for LL^T factorization

1 % 3 % 6 % 9 % 12 % 15 % 18 % 20 % 22 % 24 % 27 % 31 % 34 % 36 % 40 % 45 % 55 % 99 % 100 %

*** Error in PARDISO ( numerical_factorization) error_num= -3

*** Error in PARDISO: cgs error iparam(20) -22

================ PARDISO: solving a real struct. sym. system ================

Summary PARDISO: ( factorize to solve )

================

Times:

======

Time spent in copying matrix to internal data structure(A to LU): 0.000000 s

Time spent in factorization step(numfct) : 0.000123 s

Time spent in iterative solver a solve step(cgs) : 0.000000 s cgx iterations -22

At what point in the pardiso_unsym_c are you modifying iparm(3)?

Thanks,

Greg

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

I've attached my modification of pardiso_unsym_c.c, its return correct output. Could you modificate it and attach here to reproduce your issue?

With best regards,

Alexander Kalinkin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

I found the problem. Thank you!

After eliminating every other possibility,I noticed that I was using single-precision arrays whereas your code was using double-precision arrays. When I switched my arrays to double-preicision, the problem went away.

Since the matrices aren't going to be horribly large, I suppose we can use double-preicision arrays, but is there some reason single-precision isn't working? Could it be made to work?

Thanks again!

After eliminating every other possibility,I noticed that I was using single-precision arrays whereas your code was using double-precision arrays. When I switched my arrays to double-preicision, the problem went away.

Since the matrices aren't going to be horribly large, I suppose we can use double-preicision arrays, but is there some reason single-precision isn't working? Could it be made to work?

Thanks again!

Greg

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

The situation is strange... On my side example that I send to you work with single precision. Have you switched iparm[27] from 0 to 1?

With best regards,

Alexander Kalinkin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

--Gennady

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

*** Error in PARDISO ( numerical_factorization) error_num= -3

*** Error in PARDISO: cgs error iparam(20) -58

If Line 6 is commented out, Line 7 in un-commented, and Line 50 is commented out, the program will execute correctly. I'm using 12.0.3.

Greg

If Line 6 is commented out, Line 7 in un-commented, and Line 50 is commented out, the program will execute correctly. I'm using 12.0.3.

Greg

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

I've reproduced your issue: this error mean that iterative algorithm made maximal number of iteration (150) and didn't achive good residual.

With best regards,

Alexander Kalinkin

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page