Linking problem with magma_dsygvd

Linking problem with magma_dsygvd

Hi,I am getting multiple MKL parameter errors at different runs when I call the magma_dsygvd from a fortran code.
Hope somebody can help fix the bug.

DSYGVD Example Program Results 4LIWORK = 53LWORK = 901LDA = 10LDB = 10MKL ERROR: Parameter 1 was incorrect on entry to magma_dsygvdDSYGVD Example Program Results 4LIWORK = 53LWORK = 901LDA = 10LDB = 10MKL ERROR: Parameter 11 was incorrect on entry to magma_dsygvdOptimum workspace required = ****Workspace provided = 901Please find the source code and makefile enclosed for reference.

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I have tried with intel compilers too and get the same result:

Here`s my code:

program maininteger :: LWORK,LIWORK,NMAX,NIN,NOUT,N,LDA,LDB,NB,error,error1,error2, & error3,error4PARAMETER (NMAX=10,NIN=5,NOUT=6,NB=64, & LDA=NMAX,LDB=NMAX,LIWORK=3+5*NMAX, & LWORK=1+(NB+6+2*NMAX)*NMAX)integer*8 ITYPEDOUBLE PRECISION :: A(LDA,NMAX), B(LDB,NMAX), W(NMAX), WORK(LWORK)integer :: IWORK(LIWORK)open(NIN,file='dsygvd.dat',form='formatted')WRITE (NOUT,*) 'DSYGVD Example Program Results'WRITE (NOUT,*)! Skip heading in data fileREAD (NIN,*)READ (NIN,*) NWRITE(NOUT,*) NIF (N.LE.NMAX) THENWRITE (NOUT,*) 'LIWORK =',LIWORKWRITE (NOUT,*) 'LWORK = ',LWORKWRITE (NOUT,*) 'LDA = ',LDAWRITE (NOUT,*) 'LDB = ',LDB! Read the upper triangular parts of the matrices A and BREAD (NIN,*) ((A(I,J),J=I,N),I=1,N)READ (NIN,*) ((B(I,J),J=I,N),I=1,N)ITYPE=2call magma_dsygvd(ITYPE,'N','U',N,A,LDA,B,LDB,W,WORK,LWORK, & IWORK,LIWORK,INFO)LWOPT = WORK(1)LIWOPT = IWORK(1)IF (INFO.EQ.0) THEN!! Print solution!WRITE (NOUT,*) 'Eigenvalues'WRITE (NOUT,99999) (W(J),J=1,N)WRITE (NOUT,*) 'Eigenvectors'WRITE (NOUT,99999) ((A(I,J),J=1,N),I=1,N)END IF! Print workspace information!IF (LWORK.LT.LWOPT) THENWRITE (NOUT,*)WRITE (NOUT,99996) 'Optimum workspace required = ', LWOPT, &'Workspace provided = ', LWORKEND IFIF (LIWORK.LT.LIWOPT) THENWRITE (NOUT,*)WRITE (NOUT,99995) 'Integer workspace required = ', LIWOPT, &'Integer workspace provided = ', LIWORKEND IFELSEWRITE (NOUT,*) 'NMAX too small'END IF99999 FORMAT (3X,(6F11.4))99998 FORMAT (4X,1P,6E11.1)99997 FORMAT (1X,A,I4,A)99996 FORMAT (1X,A,I4)99995 FORMAT (1X,A,I5,/1X,A,I5)end programMakefile:magmatest3: magmatest3.f90 makefile gcc -I/sw/keeneland/cuda/4.0/linux_binary/src/ -I/sw/keeneland/cuda/4.0/linux_binary/include -c fortran.cpp -o fortran.o ifort -nus -g -c magmatest3.f90 -o magmatest3.o ifort -g -i8 -I/opt/intel/Compiler/11.1/038/mkl/ magmatest3.o fortran.o -L/sw/keeneland/magma/1.1/centos5.5_gnu4.4/magma_1.1.0/lib -lcuda -lmagma -lmagmablas -lmagma -L/opt/intel/Compiler/11.1/038/mkl/lib/em64t -L/sw/keeneland/cuda/4.0/linux_binary/lib64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -openmp -lpthread -lm -lcublas -o magmatest3

pls try to link this example with ILP64 library: lmkl_intel_ilp64

Dear Fedorov,I still get the same error after replacing lp with ilp64. The errors seem to fluctate at different runs as before.

A little tighter focus is probably needed. First get your code working with just CPU code, check that it works correctly. Only after that does it make sense to attempt to migrate the code to work with CUDA processors.

After changing the subroutine call in your posted code to CALL DSYGVD(...), I was able to compile, link and run the program on a
4 X 4 test matrix. The results printed out were in agreement with those
given elsewhere.

WolfDale:~/LANG/Magma> ifort -mkl -traceback magma.f90

WolfDale:~/LANG/Magma> ./a.out

 DSYGVD Example Program Results
  N =            4

 LIWORK =          53

 LWORK =          901

 LDA =           10

 LDB =           10


       -3.5411    -0.3347     0.2983     2.2544


        0.1373     0.9473    -0.7098    -0.6202

        0.0000    -0.2325    -2.5252     0.4797

        0.0000     0.0000    -1.2164    -0.9277

        0.0000     0.0000     0.0000    -0.0114

I gather, then, that any problems you have are confined to the CUDA libraries and device drivers that you used. Those libraries are not part of Intel Fortran, C or MKL, and you will be better off looking for CUDA support elsewhere.

Here is the test problem data:

DSYGVD Example Program Data
  4                         :Value of N
  0.24   0.39   0.42  -0.16

        -0.11   0.79   0.63

               -0.25   0.48

                      -0.03 :End of matrix A
  4.16  -3.12   0.56  -0.10

         5.03  -0.83   1.09

                0.76   0.34

                       1.18 :End of matrix B

Thank you so much.I have already tested the dsygvd lapack call as per the NAG library example. I get some linking error
There`s no clear view as of yet whether its a CUDA or MAGMA or an MKL linking error, but based on the multiple MKL parameter errors and from the this topic presumed it to be an MKL issue.Perhaps further debugging using various gdbs might give an insight of the crash.Anyway thanks for the timely help!

Leave a Comment

Please sign in to add a comment. Not a member? Join today