Software Archive
Read-only legacy content

mkl

Jen_B_
Beginner
474 Views

I wanted to use the mkl fortran subroutines (for example, mkl_?csrmm, mkl_?csrsv, ...). Just wanted to make sure I do things right

1) if I just run it on host. then I compile it as "ifort -openmp -mkl a.f90", then set env. variable MKL_NUM_THREADS. Is it enough? Or are there anything more to this?

2) if I want to run it on coprocessor in an offloaded region, then again compiles as in 1), and set env. variable MKL_MIC_ENABLE=1. Regarding the number of threads, does it pick up the MIC_OMP_NUM_THREADS variable value? Is there anything other than these?

thanks! 

0 Kudos
4 Replies
TimP
Honored Contributor III
474 Views

I think the answers are basically yes. 

As you are linking MKL shared objects, you may need to copy them over to MIC /lib64/ or mount them.  I don't know the pros and cons of dynamic vs. static linking.

MIC_KMP_PLACE_THREADS may be more useful as it sets number of threads and distributes them evenly among cores.  You could use MIC_OMP_NUM_THREADS together with MIC_OMP_PROC_BIND=spread if you don't like KMP_PLACE_THREADS.

It ought to be possible to control MIC_OMP_NUM_THREADS independently of MIC_MKL_NUM_THREADS (but I don't have experience with it).  MKL usually could use many more MIC threads effectively than your own source code would.  MKL is set up to work well with threading defaults.

If you read about MIC_KMP_STACKSIZE you will see that the default thread stack limit for offload is only 2MB (same as host limit for 32-bit mode).

0 Kudos
Jen_B_
Beginner
474 Views

Thanks! is there a way I can get offload info from the mkl function I am using? I have exported the 'OFFLOAD_REPORT=2' but it did not give me any information regarding the mkl function.

0 Kudos
TaylorIoTKidd
New Contributor I
474 Views

Jen,

Have you read the forum post https://software.intel.com/en-us/forums/topic/384980 ?

It address a similar question. Unfortunately, it is from an earlier version of the compiler but I think it is still relevant.

If the post does not answer your question, let me know and I will find an expert.

Regards
--
Taylor
 

0 Kudos
Jen_B_
Beginner
474 Views

Thanks Taylor!

0 Kudos
Reply