Global memory breaking BLAS/LAPACK routines?

Open discussion regarding features, bugs, issues, vendors, etc.

Global memory breaking BLAS/LAPACK routines?

Postby w0ss4g3 » Wed Feb 15, 2012 10:33 am

Hi,

I've got a code in fortran where I've used the variable N as shared memory - its the order of a polynomial approximation and appears in pretty much every routine I write.

Would this assignment have an effect on the routines which use N as a variable in the LAPACK/BLAS libraries?

For example DGEMV:
SUBROUTINE DGEMV(TRANS,M,N,ALPHA,A,LDA,X,INCX,BETA,Y,INCY)

One call is using: CALL DGEMV(trans, mat_rows, mat_cols, alpha, tempmat, mat_rows, tempvec_in, 1, beta, tempvec_out, 1)

Is my value, mat_cols being passed to the subroutine, or is the globally valued N being used instead?

Thanks for any help - I'm sure its a dumb question, but I'm at a loose end as to why my solver isn't agreeing with a known solution!
w0ss4g3
 
Posts: 3
Joined: Thu Jan 26, 2012 10:30 am

Re: Global memory breaking BLAS/LAPACK routines?

Postby Julien Langou » Wed Feb 15, 2012 11:17 am

Having N as a global variable in your program should not be a problem. N is input only in the BLAS interface.
The problem might be in your code. If you strongly suspect the BLAS DGEMM call, then link with the reference BLAS library which is provided within LAPACK (which you can get from http://www.netlib.org/lapack/lapack.tgz ).
(It is slower than optimized BLAS library but safer. So you can assess problems like this.)
Then if the problem is still there and you still strongly suspect the BLAS DGEMM call, simply remove the BLAS DGEMM call from your code and have three hand-made loops for the MM and start debugging from there.
I do not think the problem comes from the BLAS.
Julien.
Julien Langou
 
Posts: 733
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA


Return to User Discussion

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests