Sparse solver breaks down with bus error

Hi everybody,

I'm not sure if this question is way too trivial for you guys. I'm new with the Sun Performance Library and with Fortran in general, so please excuse if this is too obvious.

I compile the following code with -dalign and -xlic_llib=sunperf on a Sun Fire 6800. Running the binary crashes with a bus error and I simply can't figure out where the problem is.

[code]

PROGRAM example_uu_1call

! This program is an example driver that calls the sparse solver.

!It factors and solves an unsymmetric system.

IMPLICIT none

INTEGERneqns, ier, msglvl, outunt, ldrhs, nrhs

CHARACTER mtxtyp*2, pivot*1, ordmthd*3

DOUBLE PRECISION handle(150)

INTEGER*4 colstr(7), rowind(14)

DOUBLE PRECISION values(14), rhs(6)

INTEGERi

! 100101201

! 25000131

! A = 368000 rhs = 1

! 40011001

! 07000141

! 0090001

DATA colstr / 1,5,8,10,12,13,15 /

DATA rowind / 1,2,3,4,2,3,5,3,6,1,4,1,2,5 /

DATA values / 1,2,3,4,5,6,7,8,9,10,11,12,13,14 /

DATA rhs/ 1,1,1,1,1,1 /

WRITE(6,*) 'colstr =', colstr

WRITE(6,*) 'rowind =', rowind

WRITE(6,*) 'values =', values

WRITE(6,*) 'rhs=', rhs

mtxtyp= 'uu'! matrix type: unsymmetric structure, unsymmetric values

pivot = 'n'! pivoting not used in numeric factorization

neqns = size(rhs)! number of equations

nrhs= 1! number of right hand sides to solve for

ldrhs = neqns ! leading dimension of rhs array

ordmthd = 'nat'! fill-reducing ordering used by the sparse solver:

! 'nat': no ordering, 'mmd': multiple minimum degree, 'uso': user specified

outunt = 6 ! output unit

msglvl = 3 ! message level

WRITE(6,*) 'Initialization...'

CALL dgssin ( mtxtyp, pivot, neqns , colstr, rowind,outunt, msglvl, handle, ier)

IF ( ier .ne. 0 ) GOTO 110

WRITE(6,*) 'Ordering...'

CALL dgssor ( ordmthd, handle, ier )

IF ( ier .ne. 0 ) GOTO 110

WRITE(6,*) 'Factorization...'

CALL dgssfa ( neqns, colstr, rowind, values, handle, ier )

IF ( ier .ne. 0 ) GOTO 110

WRITE(6,*) 'Solution...'

CALL dgsssl ( nrhs, rhs, ldrhs, handle, ier )

IF ( ier .ne. 0 ) GOTO 110

CALL dgssda ( handle, ier )

IF ( ier .ne. 0 ) GOTO 110

WRITE(6,*) 'Solution found.'

STOP

110CONTINUE

WRITE(6,*) ' example: FAILED sparse solver error number = ', ier

STOP

END PROGRAM example_uu_1call

[/code]

Thanks for any advice. Ferdinand

Message was edited by:

listen.f.fichtner@gmx.net

[2649 byte] By [listen.f.fichtner@gmx.net] at [2007-11-26 9:47:46]
# 1

Hi,

Your matrix has zeros on the diagonal. Our sparse solver can't handle that.

It doesn't pivot. I didn't get a bus error as you did, but I got the error

message:

[code]

% ./foo

colstr = 1 5 8 10 12 13 15

rowind = 1 2 3 4 2 3 5 3 6 1 4 1 2 5

values = 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0

rhs= 1.0 1.0 1.0 1.0 1.0 1.0

Initialization...

dgssin: uu - unsymmetric mtxtyp

xGSSIN: INVALID MATRIX STRUCTURE

example: FAILED sparse solver error number = -106

[/code]

If you still have a bus error after fixing your matrix, can you provide the compiler

version you are using? Also the compile and link arguments would help too, along

with a dbx stack trace.

jeremyweek at 2007-7-7 0:54:45 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
Thanks,you're perfectly right. I wasn't aware of the fact that the solver doesn't do pivoting. Is it right then, that I have to solve the problem by solving two triangular systems, if I want to use DGSSIN ?Best wishes, Ferdinand
listenffichtner@gmxnet at 2007-7-7 0:54:45 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3

[code]

The solver and dgssin can handle a general matrix.The input matrix

doesn't have to be triangular. Your test code is fine and your general

matrix is fine. Try changing the matrix values to something like

!10010120 1

!2500013 1

! A = 368000rhs = 1

!4001100 1

!0700414 1

!009006 1

DATA colstr / 1,5,8,10,12,14,17 /

DATA rowind / 1,2,3,4,2,3,5,3,6,1,4,1,5,2,5,6 /

DATA values / 1,2,3,4,5,6,7,8,9,10,11,12,4,13,14,6 /

DATA rhs/ 1,1,1,1,1,1 /

Basically, dgssin (initialization), dgssor (ordering) and dgssfa (factoring)

factor a general (or SPD) matrix into triangular L and U. The solve

step (dgsssl) actually solves the triangular system.

[/code]

jeremyweek at 2007-7-7 0:54:45 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4

thanks again,

but what do I do if the matrix has zeros on the diagonal, as it does in my case? I at least have to permute it's rows until I have a fully populated diagonal, right? And I have to do this before I pass the matrix to the solver.

Is there a way to tell perflib to do this? Or what would be an efficient way to do it?

Sorry I have to insist on this... Hope this is not to basic.

Thanks, Ferdinand

listenffichtner@gmxnet at 2007-7-7 0:54:45 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 5

Currently, there is no way to tell Perflib to do this. However there will be in the next

release.

We are working on adding the SuperLU software, which does partial

pivoting, into our Perflib interface. A new flag has been added to

DGSSIN to select it. When I tested your original driver with DSSIN

set to call SuperLU, I get

colstr = 0 4 7 9 11 12 14

rowind = 0 1 2 3 1 2 4 2 5 0 3 0 1 4

values = 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0

rhs= 1.0 1.0 1.0 1.0 1.0 1.0

Initialization...

dgssin: initialize for SuperLU

xGSSIN: NORMAL TERMINATION

Ordering...

ordering option: 1 - natural

xGSSOR: NORMAL TERMINATION

Factorization...

xGSSFA: NORMAL TERMINATION

Solution...

xGSSSL: NORMAL TERMINATION

0.036075036075036065

4.810004810004788E-4

0.1111111111111111

0.07779089597271416

0.015501333683151866

0.07118807118807119

xGSSDA: NORMAL TERMINATION

Solution found.

You can get early access to these releases at :

http://developers.sun.com/prodtech/cc/downloads/express.jsp

However, the SuperLU interfaces are not there yet. They should be there in the next

few weeks. If you like, I could e-mail you when that release is available.

In the meantime, you could get the public version of SuperLU to hold you over. This is

at :

http://crd.lbl.gov/~xiaoye/SuperLU/

jeremyweek at 2007-7-7 0:54:45 > top of Java-index,Development Tools,Solaris and Linux Development Tools...