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

Calling Pardiso in parallel loop

Meysam_J_
Beginner
292 Views

Hi,

I am using Pardiso for a little while and I am happy with it. It works fine in parallel and I can use all the cores on my machine. Recently I wanted to call pardiso in a for loop to solve different equation systems. The for loop itself is parllelized using openmp (#pragma omp parallel). Now the problem is wheh I call pardiso in this loop it only runs with one single core! The code is as the following 

.........

njbs = 8;

nthr = 6;
N is the number of equation systems


#pragma omp parallel for num_threads(njbs) schedule(dynamic,1)
      for (i=0; i<N; i++)
      {

             B = get_equation _system_number(i); /* B is the handle to the corresponding equation system number i*/

             init(B); /*set all the pointers and corresponding parameters in B. set pt = 0 for this solver*/  

             omp_set_num_threads(nthr);
             B.iparm[2]=omp_get_max_threads(); /*B.iparm[2] is 6 now*/

             B->phase = 11;

             PARDISO (pt, &(B->maxfct), &(B->mnum), &(B->mtype), &(B->phase),
             &B->n,  B->a, B->ia, B->ja, &(B->idum), &(B->nrhs),    
             B->iparm, &(B->msglvl),&(B->ddum), &(B->ddum), &(B->error));

     }

when msglvl is activated to show statistics, I get

< Parallel Direct Factorization with number of processors: > 1

Now the question is why does pardiso run in serial? Do I do something wrong or do I have missed something?

Best regards,

Meysam

0 Kudos
1 Reply
Meysam_J_
Beginner
292 Views
0 Kudos
Reply