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

MKL with valgrind

heiga
Beginner
3,035 Views
When I try to check any tools using MKL by Valgrind, I always receive some warnings as follows: ==13662== Syscall param sched_setaffinity(mask) points to unaddressable byte(s) ==13662== at 0x423BE7: syscall (in /lib/libc-2.5.so) ==13662== by 0x4931723: __kmp_affinity_determine_capable (in /usr/local/intel/compiler10.0.023/lib/libguide.so) ==13662== by 0x4927173: (within /usr/local/intel/compiler10.0.023/lib/libguide.so) ==13662== by 0x49253BF: (within /usr/local/intel/compiler10.0.023/lib/libguide.so) ==13662== by 0x4925535: __kmp_serial_initialize (in /usr/local/intel/compiler10.0.023/lib/libguide.so) ==13662== by 0x4917CB7: __kmpc_global_thread_num (in /usr/local/intel/compiler10.0.023/lib/libguide.so) ==13662== by 0x71980EA: mkl_lapack_dpotrf (in /usr/local/intel/mkl9.1.018/lib/32/libmkl_lapack.so) ==13662== by 0x80A7DC7: AccStatsMean (HTrjTrain.c:671) ==13662== by 0x80A960E: UpTrjMeansVars (HTrjTrain.c:1231) ==13662== by 0x80AA3C4: UpTrjModels (HTrjTrain.c:1456) ==13662== by 0x8049F34: main (HTrjCompV.c:222) ==13662== Address 0x0 is not stack'd, malloc'd or (recently) free'd In all cases, it happens at the first call of an MKL function. So I guess it is caused by MKL.
0 Kudos
1 Solution
TimP
Honored Contributor III
3,035 Views
The valgrind indication doesn't indicate any problem with your code.

View solution in original post

6 Replies
heiga
Beginner
3,035 Views
Sorry, my previous post was very hard to readSad smiley [:(]

When I try to check any tools using MKL by Valgrind, I always receive some warnings as follows:

==13662== Syscall param sched_setaffinity(mask) points to unaddressable byte(s)
==13662== at 0x423BE7: syscall (in /lib/libc-2.5.so)
==13662== by 0x4931723: __kmp_affinity_determine_capable (in /usr/local/intel/compiler10.0.023/lib/libguide.so)
==13662== by 0x4927173: (within /usr/local/intel/compiler10.0.023/lib/libguide.so)
==13662== by 0x49253BF: (within /usr/local/intel/compiler10.0.023/lib/libguide.so)
==13662== by 0x4925535: __kmp_serial_initialize (in /usr/local/intel/compiler10.0.023/lib/libguide.so)
==13662== by 0x4917CB7: __kmpc_global_thread_num (in /usr/local/intel/compiler10.0.023/lib/libguide.so)
==13662== by 0x71980EA: mkl_lapack_dpotrf (in /usr/local/intel/mkl9.1.018/lib/32/libmkl_lapack.so)
==13662== by 0x80A7DC7: AccStatsMean (HTrjTrain.c:671)
==13662== by 0x80A960E: UpTrjMeansVars (HTrjTrain.c:1231)
==13662== by 0x80AA3C4: UpTrjModels (HTrjTrain.c:1456)
==13662== by 0x8049F34: main (HTrjCompV.c:222)
==13662== Address 0x0 is not stack'd, malloc'd or (recently) free'd

In all cases, it happens at the first call of an MKL function.
So I guess it is caused by MKL.
0 Kudos
TimP
Honored Contributor III
3,035 Views
Yes, your backtrace indicates that you called an MKL threaded function, and valgrind is directing your attention to behavior of a pthreads function called by the Intel OpenMP libraries.
Further than that, I don't know what your question is. When using Intel thread checker, before the time when serial MKL libraries were available, I had to replace MKL functions with equivalent source code. If you don't require MKL to spawn its own threads, the serial MKL might suit your purpose better.
0 Kudos
paul_f
New Contributor I
1,684 Views

Strictly speaking there is no call to pthreads (or glibc) functions. Rather than calling 'sched_setaffinity()' the function, this is a call to 'syscall' for the 'sched_setaffinity' syscall.

0 Kudos
heiga
Beginner
3,035 Views
Hi Tim, thank you very much for your immediate reply.

My question is that is it a bug of MKL or my source code?
Is it OK to ignore this message?
0 Kudos
TimP
Honored Contributor III
3,036 Views
The valgrind indication doesn't indicate any problem with your code.
heiga
Beginner
3,035 Views
Thank you so much!!
0 Kudos
Reply