- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am having an oddproblem with the FGMRES sparse solver. My first two calls to DFGMRES successfully return valuesRCI_Request = 1 and RCI_Request = 3, however, after the appropriate actions have been taken and control is returned to DFGMRES, I receive the following error in MKL_RCI_FGMRES_Log.txt:
------------------------------------------------------------------------------
MKL RCI FGMRES ERROR:
Parameter IPAR(19)=0 must be a positive integer. Probably,
parameter IPAR(19) was altered by mistake outside of DFGMRES routine. The solution
may be wrong...
Note that IPAR(19) = 0 immediately after calling DFGMRES_INIT, so it seems that it should have this value still during the first iteration (IPAR(19) is a service variable denoting the location of certain information in the TMP work array). I can't think of any reason for this problem, so any help would be greatly appreciated. Thanks.
Lee
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just to be clear, I do not manually modify IPAR(19) at any point. If it is helpful, the relevant portion of my code (strict F77, with the exception that some arrays are allocatable, as was suggested in my other thread of a few days ago) is given below:
CALL DFGMRES_INIT(NEQ,XN,BN, RCIREQ,IPAR,DPAR,TMP)
IF(RCIREQ.NE.0) THEN
WRITE(ITERMO,5000)
GOTO 9999
ENDIF
*
IPAR(1) = NEQ
IPAR(2) = 1
IPAR(3) = 1
IPAR(4) = 0
IPAR(5) = MAXITS
IPAR(6) = 1
IPAR(7) = 1
IPAR(8) = 1
IPAR(9) = 1
IPAR(10) = 0
IPAR(11) = 1
IPAR(12) = 1
IPAR(13) = 0
IPAR(14) = 0
IPAR(15) = RSTITS
IPAR(31) = 1
*
DPAR(1) = RTOL
DPAR(2) = ATOL
DPAR(3) = 0.0
DPAR(4) = 0.0
DPAR(5) = 0.0
DPAR(6) = 0.0
DPAR(7) = 0.0
DPAR(8) = ZTOL
DPAR(31) = 10.0**(-20)
DPAR(32) = 10.0**(-12)
*
* Preconditioner
*
CALL NULLV(BILU0, 1,NENT,NENT)
CALL DCSRILU0(NEQ,AN,IA,JA, BILU0,IPAR,DPAR,IERR)
IF(IERR.NE.0) THEN
WRITE(ITERMO,5000)
GOTO 9999
ENDIF
*
* Solver
*
1000 CONTINUE
CALL DFGMRES(NEQ,XN,BN, RCIREQ,IPAR,DPAR,TMP)
*
* Proceed according to Reverse Communication Interface
* request from solver given in RCIREQ
*
IF(RCIREQ.EQ.0) THEN
*
* Solution obtained
*
GOTO 2000
*
ELSEIF(RCIREQ.EQ.1) THEN
*
* Multiply coefficient matrix by work vector and
* return to solver
*
COUNT = IPAR(22)
DO 1100 I=1,NEQ
WORK1(I) = TMP(COUNT)
COUNT = COUNT+1
1100 CONTINUE
CALL MKL_DCSRGEMV('N',NEQ,AN,IA,JA,WORK1, WORK2)
COUNT = IPAR(23)
DO 1105 I=1,NEQ
TMP(COUNT) = WORK2(I)
COUNT = COUNT+1
1105 CONTINUE
GOTO 1000
*
ELSEIF(RCIREQ.EQ.3) THEN
*
* Apply preconditioner and return to solver
*
COUNT = IPAR(22)
DO 1300 I=1,NEQ
WORK1(I) = TMP(COUNT)
COUNT = COUNT+1
1300 CONTINUE
CALL MKL_DCSRTRSV('L','N','U',NEQ,BILU0,IA,JA,
C WORK1, TRVEC)
CALL MKL_DCSRTRSV('U','N','N',NEQ,BILU0,IA,JA,
C TRVEC, WORK2)
COUNT = IPAR(23)
DO 1305 I=1,NEQ
TMP(COUNT) = WORK2(I)
COUNT = COUNT+1
1305 CONTINUE
GOTO 1000
*
ELSE
*
* Failure of solution procedure
*
WRITE(ITERMO,5000)
GOTO 9999
*
ENDIF
*
* Obtain solution and assign
*
2000 CONTINUE
CALL DFGMRES_GET(NEQ, XN,BN,RCIREQ,IPAR,DPAR,TMP,ICOUNT)
IF(RCIREQ.NE.0) THEN
WRITE(ITERMO,5000)
GOTO 9999
ENDIF
ROW = 1
DO 2010 I=IB,IE
DO 2005 J=1,N
SOL(N*(I-IB)+J) = XN(ROW)
ROW = ROW+1
2005 CONTINUE
2010 CONTINUE
Lee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just to be clear, I do not manually modify IPAR(19) at any point. If it is helpful, the relevant portion of my code (strict F77, with the exception that some arrays are allocatable, as was suggested in my other thread of a few days ago) is given below:
CALL DFGMRES_INIT(NEQ,XN,BN, RCIREQ,IPAR,DPAR,TMP)
IF(RCIREQ.NE.0) THEN
WRITE(ITERMO,5000)
GOTO 9999
ENDIF
*
IPAR(1) = NEQ
IPAR(2) = 1
IPAR(3) = 1
IPAR(4) = 0
IPAR(5) = MAXITS
IPAR(6) = 1
IPAR(7) = 1
IPAR(8) = 1
IPAR(9) = 1
IPAR(10) = 0
IPAR(11) = 1
IPAR(12) = 1
IPAR(13) = 0
IPAR(14) = 0
IPAR(15) = RSTITS
IPAR(31) = 1
*
DPAR(1) = RTOL
DPAR(2) = ATOL
DPAR(3) = 0.0
DPAR(4) = 0.0
DPAR(5) = 0.0
DPAR(6) = 0.0
DPAR(7) = 0.0
DPAR(8) = ZTOL
DPAR(31) = 10.0**(-20)
DPAR(32) = 10.0**(-12)
*
* Preconditioner
*
CALL NULLV(BILU0, 1,NENT,NENT)
CALL DCSRILU0(NEQ,AN,IA,JA, BILU0,IPAR,DPAR,IERR)
IF(IERR.NE.0) THEN
WRITE(ITERMO,5000)
GOTO 9999
ENDIF
*
* Solver
*
1000 CONTINUE
CALL DFGMRES(NEQ,XN,BN, RCIREQ,IPAR,DPAR,TMP)
*
* Proceed according to Reverse Communication Interface
* request from solver given in RCIREQ
*
IF(RCIREQ.EQ.0) THEN
*
* Solution obtained
*
GOTO 2000
*
ELSEIF(RCIREQ.EQ.1) THEN
*
* Multiply coefficient matrix by work vector and
* return to solver
*
COUNT = IPAR(22)
DO 1100 I=1,NEQ
WORK1(I) = TMP(COUNT)
COUNT = COUNT+1
1100 CONTINUE
CALL MKL_DCSRGEMV('N',NEQ,AN,IA,JA,WORK1, WORK2)
COUNT = IPAR(23)
DO 1105 I=1,NEQ
TMP(COUNT) = WORK2(I)
COUNT = COUNT+1
1105 CONTINUE
GOTO 1000
*
ELSEIF(RCIREQ.EQ.3) THEN
*
* Apply preconditioner and return to solver
*
COUNT = IPAR(22)
DO 1300 I=1,NEQ
WORK1(I) = TMP(COUNT)
COUNT = COUNT+1
1300 CONTINUE
CALL MKL_DCSRTRSV('L','N','U',NEQ,BILU0,IA,JA,
C WORK1, TRVEC)
CALL MKL_DCSRTRSV('U','N','N',NEQ,BILU0,IA,JA,
C TRVEC, WORK2)
COUNT = IPAR(23)
DO 1305 I=1,NEQ
TMP(COUNT) = WORK2(I)
COUNT = COUNT+1
1305 CONTINUE
GOTO 1000
*
ELSE
*
* Failure of solution procedure
*
WRITE(ITERMO,5000)
GOTO 9999
*
ENDIF
*
* Obtain solution and assign
*
2000 CONTINUE
CALL DFGMRES_GET(NEQ, XN,BN,RCIREQ,IPAR,DPAR,TMP,ICOUNT)
IF(RCIREQ.NE.0) THEN
WRITE(ITERMO,5000)
GOTO 9999
ENDIF
ROW = 1
DO 2010 I=IB,IE
DO 2005 J=1,N
SOL(N*(I-IB)+J) = XN(ROW)
ROW = ROW+1
2005 CONTINUE
2010 CONTINUE
Lee
Hi Lee,
To correctness you need tocall DFGMRES_CHECKbetween init of preconditioner (DCSRILU0) and main part of DFGMRES.
With best regards,
Alexander
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't believe I forgot to do the check! Thank you so much. I'll try that now.
Lee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can't believe I forgot to do the check! Thank you so much. I'll try that now.
Lee
Lee,
You are welcome :)
Alexander

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