Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Help! 64-bit MKL BLAS

lixxsmart_mit_edu
557 Views

Hello, I am new user of MKL and trying to merge my programs written in Fortran 90 on 32-bit Linux to 64-bit Linux. But some troubles appear.

The current Linux system is a dual quad-core Xeon system (interactive node of a linux cluster) with CentOS 5.2 (x86_64), intel fortran compiler 10.1.0, MKL 10.0.3.020.15

I used many vector-math mutiplication subroutines from BLAS (DSCAL, DAXPY, DCOPY, DDOT, ...). In my old 32-bit Linux cluster system (i386, Redhat 9, and goto BLAS library), it's okay. But on the 64-bit system, I used the command-line to compile:

$ ifort -g -i4 -r8 -o test_qmr test_qmr.f qmr.f xerbla.f -lmkl_em64t

It compiled smoothly. When I try to run ./test_qmr, error messages appeard:

forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
test_qmr 000000000040A2FA Unknown Unknown Unknown
test_qmr 00000000004140A3 Unknown Unknown Unknown
test_qmr 0000000000402FC2 Unknown Unknown Unknown
libc.so.6 00000034FF01D8B4 Unknown Unknown Unknown
test_qmr 0000000000402EE9 Unknown Unknown Unknown

Then I comipled like this

$ ifort -g -i8 -r16 -o test_qmr test_qmr.f qmr.f xerbla.f -lmkl_em64t

the result becoming

Iteration fail
rho = NaN xi =
5.656159843027550937243901911628268E-4940
NO. ITER = 0 ERROR =
2.718736082757232227640224530217762E-4935
0.000000000000000000000000000000000E+0000
0.000000000000000000000000000000000E+0000
0.000000000000000000000000000000000E+0000
0.000000000000000000000000000000000E+0000
which is apparently wrong. I can get the correct answer when I use 32-bit version ifort and mkl on the same 64-bit machine:

$ /opt/intel/fc/9.1.045/bin/ifort -O2 -i4 -r8 -o test_qmr test_qmr.f qmr.f xerbla.f -L/opt/intel/mkl/10.0.5.025/lib/32 -lmkl_ia32

and the result is

$ ./test_qmr
NO. ITER = 4 ERROR = 3.783760209647154E-031
1.66666666666667 0.574074074074074 0.111111111111111 0.370370370370370

Anyone has an idea of this kind of problem? If I haven't made myself clear, please forgive me. I don't know if I can updoad the programs here.

Many thanks.

0 Kudos
3 Replies
Gennady_F_Intel
Moderator
557 Views
Could you please try the following linking line for BLAS functionality:
ifort -w test.f /opt/intel/mkl/10.0.3.020/lib/em64t/libmkl_intel_lp64.a /opt/intel/mkl/10.0.3.020/lib/em64t/libmkl_intel_thread.a
/opt/intel/mkl/10.0.3.020/lib/em64t/libmkl_core.a -L/opt/intel/mkl/10.0.3.020/lib/em64t -lguide -lpthread
-o test.out
--Gennady

0 Kudos
lixxsmart_mit_edu
557 Views

Could you please try the following linking line for BLAS functionality:
ifort -w test.f /opt/intel/mkl/10.0.3.020/lib/em64t/libmkl_intel_lp64.a /opt/intel/mkl/10.0.3.020/lib/em64t/libmkl_intel_thread.a
/opt/intel/mkl/10.0.3.020/lib/em64t/libmkl_core.a -L/opt/intel/mkl/10.0.3.020/lib/em64t -lguide -lpthread
-o test.out
--Gennady

I found if there is no "-i4 -i8" the compilation is okay and the program can run, but the resut is not correct.

When compiling with the command you provided above (static link) without specification of integer-size and real-size, the result is like this:

Iteration fail
rho = -1.1745938E-19 xi = -7.1265819E-38
NO. ITER = 0 ERROR = -7.1265819E-38
0.0000000E+00 0.0000000E+00 0.0000000E+00 0.0000000E+00

which is also wrong.

I also tried the latest MKL version 10.0.5.250 on another x86_64 linux cluster and the result is the same.

0 Kudos
TimP
Honored Contributor III
557 Views
MKL has no support for -r16, as you could read in previous responses.
If you call the double precision BLAS functions without using either -i4 (default)or -i8 (not default), you must declare the floating point arguments as double precision. Using the appropriate include files would help diagnose problems.
0 Kudos
Reply