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

Problem with DGEMM - ILP interface

kaushik
Beginner
398 Views
Hi,

I am getting a SIGSEGV Segmentation fault with dgemm.
Here`s a snippet of my code:

subroutine hostgemm(M,LD, A,B,C,alpha)

Implicit none
integer sizeof_real,sizeof_real8
parameter (sizeof_real=4)
parameter (sizeof_real8=8)
Real*8 A(*),B(*),C(*)
Real*8 alpha,beta, one
Integer :: M, LD, MM
#ifdef LAPACK_I4
Integer*4 :: MI,LDI
#else
Integer*8 :: MI,LDI
#endif

MI = M
LDI = LD
LD=M
one =1.0d0
!alpha =1.0d0
beta = 0.0d0
MM=M*M

write(*,*)'Into dgemm'
call dgemm('n','n',MI,MI,MI,1.0d0,A,LDI,B,LDI,0.0d0,C,LDI)
c call dgemm('n','n',M,M,M,1.0d0,A,LD,B,LD,0.0d0,C,LD)
end

Makefile:

$(FC0) $(DEBUGFLAGS) -DMKL_ILP64 -fdefault-integer-8 -m64 -I$(MKLROOT)/include -o lvnopt.exe $(OBJLVN) $(NUTIL) $(BLAS) liblvn.a -L$(MKLROOT)/lib/intel64 -lmkl_gf_ilp64 -lmkl_gnu_thread -lmkl_core -fopenmp -lpthread -lm -L$(CUDADIR)/lib64 -lcublas -lcuda -lcudart -lm

I have tried both 32 and 64 bit integer with LP and ILP interfaces and get the same segmentation fault.
Here`s the result from debugger

Program received signal SIGSEGV, Segmentation fault.

[Switching to Thread 0x4160a940 (LWP 24254)]
0x00002aaab3b9c3a0 in mkl_blas_dgemm_mscale () from /opt/intel/composer_xe_2011_sp1.8.273/mkl/lib/intel64/libmkl_mc3.so
(gdb) info s
#0 0x00002aaab3b9c3a0 in mkl_blas_dgemm_mscale () from /opt/intel/composer_xe_2011_sp1.8.273/mkl/lib/intel64/libmkl_mc3.so
#1 0x00002aaaabda6995 in mkl_blas_dgemm_mscale () from /opt/intel/composer_xe_2011_sp1.8.273/mkl/lib/intel64/libmkl_core.so
#2 0x00002aaaab324242 in mkl_blas_dgemm.omp_fn.0 () from /opt/intel/composer_xe_2011_sp1.8.273/mkl/lib/intel64/libmkl_gnu_thread.so
#3 0x00002aaab363af52 in ?? () from /usr/lib64/libgomp.so.1
#4 0x0000003ea580673d in start_thread () from /lib64/libpthread.so.0
#5 0x0000003ea4cd44bd in clone () from /lib64/libc.so.6

Note: I have to use ILP interface as I have matrices more than 2^31 - 1, the largest that can be run with LP interface.
Any help wil be really appreciated.






0 Kudos
1 Reply
kaushik
Beginner
398 Views
Hello,

The probelm has been resolved!
C wrappers with MKL_INT variable declarations was a quick fix. Now the code runs for both LP and ILP interface.
0 Kudos
Reply