Community
cancel
Showing results for 
Search instead for 
Did you mean: 
jackyjngwn
Beginner
58 Views

Problem in using threaded BLAS kernels

Hi,

I am trying to use the parallel version of sgemm, but no matter how many threads I set to use, the program runs on one core only (on a 12-core westmere). Can anyone help me?

I am using Intel Compiler 11.1.073, and my makefile is:
icc -o blassgemm blassgemm.c -openmp -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_lapack -lmkl_core -liomp5 -lpthread

I set the number of threads using mkl_set_num_threads.

Thanks,
Jacky

0 Kudos
5 Replies
58 Views

Can you also tell us what are the values for the thread control env variables like, MKL_SET_NUM_THREADS, MKL_DYNAMIC etc?
jackyjngwn
Beginner
58 Views

I didn't set MKL_SET_NUM_THREADS. Instead, I set OMP_NUM_THREADS to 4 and in the program I used mkl_set_num_threads(4).

Do I still need to set MKL_SET_NUM_THREADS and MKL_DYNAMIC? Thanks.

TimP
Black Belt
58 Views

If you leave MKL_DYNAMIC unset, MKL will be limited to 1 thread per core, as this normally gives best performance. If your problem isn't large enough to use all cores, MKL would automatically choose a smaller number. When you call omp_set_num_threads or mkl_set_num_threads in your program, that over-rides the environment variable.
Gennady_F_Intel
Moderator
58 Views

what is the task size are you trying to solve?
jackyjngwn
Beginner
58 Views

That seems to solve my problem. Thanks a lot!

Reply