Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
15 Views

Can't set number of threads >32 for Pardiso solver in MKL library

I'm running the pardiso solver on a machine with CentOS 6.5 using Fortran.  I'm using MKL v 11.3

When I set the number of threads using either environment variable MKL_NUM_THREADS or inside the Fortran code, using the mkl_set_num_threads() function, everything works as expected when I define the number of threads to be 32 or less.  Whenever, I set the number of the number of threads to be anything larger than 32, say for example 48, pardiso only sees 32 threads.

My machine has 4 cpu's with 16 cores in each cpu, and I have the entire machine to myself.  So ... I'd like to set the number of threads to be 64.

 

Any ideas of how I can do this?

Many thx,

Bob

0 Kudos
3 Replies
Highlighted
Employee
15 Views

Hi rdees,

have you ever checked maximum number of threads you could use (mkl_get_max_threads())? You could also try with OpenMP:

omp_set_num_threads( 48 );
#pragma omp parallel num_threads( 48 )
{
...
}

Best regards,
Fiona

0 Kudos
Highlighted
Beginner
15 Views

Fiona,

Thx for the hint.  I fiddled around a bit more and got it to work.

When I tried setting the number of threads using the function mkl_set_num_threads(48) it did not work, (i.e. instead it still set the number of threads to 32).  If I issued the line mkl_set_num_threads(8), it did set the number of threads to 8.  mkl_set_num_threads function works as long as I set the number to be less than or equal to 32.

However, if I issue  the command mkl_set_num_threads_local(48), I do indeed get access to 48 threads.

I'm not quite sure why it works with mkl_set_num_threads_local and not mkl_set_num_threads. 

If anyone knows why, I'd be quite interested.

Thx,

Bob

0 Kudos
Highlighted
Employee
15 Views

Hi rdees,

mkl_set_num_threads() would not set limitation for number of threads, normally you could use any number of threads which is less than maximum threads you have in your system. Could you please tell me the size of matrix you calculated in your code, you might could not use large number of threads for small size of matrix. Please test with large size of matrix and also try to use mkl_set_dynamic(0) to disable dynamic adjustment of threads.

mkl_set_dynamic(0);
mkl_set_num_threads(48);
//your code calling pardiso
...

 

0 Kudos