- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am attempting to get DSS to operate through Visual Studio 2008 to solve the sparse matrix problem Ax=B where A=GLK and B=BL. The code first converts A=GLK to CDR format, assigns BL, then calls Solver to deploy the DSS functions. The program runs fine through the call to DSS_CREATE, then exits with an error at line DSS_DEFINE_STRUCTURE. Error and code are below.
Since the first DSS function executes, I am assuming compiler configurations for MKL library are fine. Is there a way to debug to find the problem in execution of DSS_DEFINE_STRUCTURE? How do we interpret code -8?
Many thanks for any help.
**********ERROR*************
The program '[5004] doudican_current.exe: Native' has exited with code -8 (0xfffffff8).
*******CODE***********
!***********************************************************************
!
SUBROUTINE DOUDICAN_SOLVE (GLK, BL, SOLUTION)
!
! THIS SUBROUTINE
!
USE all
!
implicit none
!
REAL(KIND=DBL), INTENT(IN), DIMENSION(NEQ, NEQ) :: GLK
REAL(KIND=DBL), INTENT(IN), DIMENSION(NEQ) :: BL
REAL(KIND=DBL), INTENT(OUT), DIMENSION(NEQ) :: SOLUTION
REAL(KIND=DBL), ALLOCATABLE, DIMENSION(:) :: RHS, VALUES
INTEGER, ALLOCATABLE, DIMENSION(:) :: COLUMNS
INTEGER, DIMENSION(NEQ+1) :: ROWINDEX
INTEGER ::I, J, KOUNT,NROWS
!
! ALTERNATVE DIRECT SPARSE SOLVER
!
KOUNT=COUNT(GLK/=0d0)
ALLOCATE ( VALUES(KOUNT), COLUMNS(KOUNT) )
KOUNT = 0
ROWINDEX(1)=1
DO J=1,NEQ
ROWINDEX(J+1)=ROWINDEX(J)
DO I=1,NEQ
IF (GLK(J,I)/=0) THEN
ROWINDEX(J+1)=ROWINDEX(J+1)+1
KOUNT=KOUNT+1
VALUES(KOUNT)=GLK(J,I)
COLUMNS(KOUNT)=I
END IF
END DO
END DO
!
NROWS = NEQ
ALLOCATE ( RHS(NROWS) )
RHS = BL
!
CALL SOLVER ( VALUES, COLUMNS, ROWINDEX, RHS, KOUNT, NROWS, SOLUTION )
!
RETURN
END SUBROUTINE DOUDICAN_SOLVE
!
!***********************************************************************
!***********************************************************************
SUBROUTINE SOLVER ( VALUES, COLUMNS, ROWINDEX, RHS, KOUNT, NROWS, SOLUTION )
!
USE ALL
use mkl_dss
!
IMPLICIT NONE
INTEGER, PARAMETER :: dp = KIND(1.0D0)
INTEGER :: error
INTEGER :: i, KOUNT
INTEGER, PARAMETER :: bufLen = 20
! Define the data arrays and the solution and rhs vectors.
INTEGER, DIMENSION(KOUNT) :: columns
INTEGER :: nCols
INTEGER :: nNonZeros
INTEGER :: nRhs
INTEGER :: nRows
REAL(KIND=DP), DIMENSION(NROWS) :: rhs
INTEGER, DIMENSION(NEQ+1) :: rowIndex
REAL(KIND=DBL), DIMENSION(NEQ) :: solution
REAL(KIND=DP), DIMENSION(KOUNT) :: values
TYPE(MKL_DSS_HANDLE) :: handle ! Allocate storage for the solver handle.
REAL(KIND=DP),ALLOCATABLE::statOUt( : )
CHARACTER*15 statIn
INTEGER perm(1)
INTEGER buff(bufLen)
!
! Set the problem to be solved.
!
nCols = 5
nNonZeros = KOUNT
nRhs = 1
perm(1) = 0
!
! Initialize the solver.
error = DSS_CREATE( handle, MKL_DSS_DEFAULTS )
IF (error /= MKL_DSS_SUCCESS) GOTO 999
!
! Define the non-zero structure of the matrix.
!
! *NOTE: ERROR OCCURS IN NEXT LINE*
!
error = DSS_DEFINE_STRUCTURE( handle, MKL_DSS_SYMMETRIC, rowIndex, nRows, &
& nCols, columns, nNonZeros )
IF (error /= MKL_DSS_SUCCESS) GOTO 999
!
! Reorder the matrix.
error = DSS_REORDER( handle, MKL_DSS_DEFAULTS, perm )
IF (error /= MKL_DSS_SUCCESS) GOTO 999
!
! Factor the matrix.
error = DSS_FACTOR_REAL( handle, MKL_DSS_DEFAULTS, values )
IF (error /= MKL_DSS_SUCCESS) GOTO 999
!
! Solve the problem.
error = DSS_SOLVE_REAL(handle, MKL_DSS_DEFAULTS, rhs, nRhs, solution )
IF (error /= MKL_DSS_SUCCESS) GOTO 999
!
! Deallocate solver storage and various local arrays.
error = DSS_DELETE( handle, MKL_DSS_DEFAULTS )
IF (error /= MKL_DSS_SUCCESS ) GOTO 999
!
! Print the solution vector, deallocate it and exit
WRITE(*,"('Solution Array: '(5F10.3))") ( solution(i), i = 1, nCols )
GOTO 1000
!
! Print an error message and exit
999 WRITE(*,*) "Solver returned error code ", error
STOP 1
!
1000 CONTINUE
pause
END SUBROUTINE SOLVER
!***********************************************************************
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
that's mean your input matrix is not square:
DSS software operates only on square matrices, sonRowsmust be equal tonCols.
see mkl_dss.h file as an example: #define MKL_DSS_NOT_SQUARE -8--Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Subroutine Solver you have "nCols = 5"; should that have been "ncols=NEQ" ?
Reply
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