[petsc-users] Using multithreaded MKL in PETSc

Barry Smith bsmith at mcs.anl.gov
Tue Mar 8 14:22:46 CST 2016


> On Mar 8, 2016, at 2:07 PM, Vasileios Kalantzis <kalan019 at umn.edu> wrote:
> 
> Hi everyone,
> 
> Assuming that I want to use MKL's Pardiso in the 
> context of PETSc (I need it as a local solver for
> block Jacobi type preconditioning), how should I form
> my ./configure so that I can take advantage of 
> multi-threading when calling MKL's Pardiso?
> 
> For example, do I simply have to configure with
> --with-openmp=1 --with-pthread=1 and/or similar?
> I have tried different combinations and thought
> of asking,
> 
> Thank you!
> 
> ps. right now I use flat MPI and works fine, I want
> to use threading to add a second level of parallelism, 

  If you do this then the only part of the code that takes advantage of that "second level of parallelism" will be within the MKL solver. The rest of the code will not use those "extra" threads. You must make sure you run MPI on less cores so there are enough "free" cores to run the threads for the the MKL solver.

  To utilize MKL's Pardiso you don't need to configure PETSc with any mention of openmp or pthreads you just need to set appropriate MKL environmental variables so that MKL's Pardiso will use multiple threads. Or you can use MatMkl_PardisoSetCntl() see the manual page for MATSOLVERMKL_PARDISO etc



   Barry



> 
> 



More information about the petsc-users mailing list