Quantcast
Channel: Recent posts
Viewing all articles
Browse latest Browse all 190

gfortran+MKL+zdotc => CRASH

$
0
0

I have discovered a crash/bug when attempting to link a fortran program compiled using gfortran 4.7.2 against MKL in 32-bit mode.

The symptoms are that the BLAS function ZDOTC returns an incorrect result -

        ZDOTC returned  (  0.0000000000000000     ,  1.5907197451559738E-314)   Expected  (-0.75000000000000000     ,  1.0000000000000000     )

This is in fact the output of a test I inserted in my code some time ago to guard against linking with LAPACK and BLAS with an incompatible calling convention (eg g77 vs ifort) , and it is being triggered when I link a gfortran compile against MKL in 32-bit mode.

My link line contains

 -L"/opt/intel/composer_xe_2011_sp1.11.339/mkl/lib/ia32"  -Wl,--start-group -lmkl_gf -lmkl_core -lmkl_sequential -Wl,--end-group

as recommended by the link adviser, and succeeds without any warnings.

The fault occurs with both MKL 10.3.11 and 11.0.1, and with gfortran 4.7.2, on x86_64 linux.

It does NOT happen in "intel64" mode with the same versions of the compilers and libraries. 

The error is NOT triggered when linking the same object files against either OpenBLAS or ACML.

It occurs irrespective of whether the link is with static or shared libraries.

The zdotc test itself has not given a false positive yet when used with a wide suite of compilers and libraries, so I don't think it is wrong now (and in any case the result of commenting out the check is a segfault).FYI it declares ZDOTC with the interface

    interface
       function zdotc(N, X, INCX, Y, INCY)
         use constants, only : dp
         integer :: n, incx, incy
         complex(kind=dp), dimension(*) :: X, Y
         complex(kind=dp) :: zdotc
       end function zdotc
    end interface

(where dp = 8) and simply calls it with a short vector, testing the result against the expected value.

I suspect a bug in libmkl_gf, or an incompatibility with this version of GNU fortran.  Can anyone enlighten me or confirm or deny my suspicion?

Keith Refson


Viewing all articles
Browse latest Browse all 190

Trending Articles