[petsc-users] MatMkl_CPardisoSetCntl

Barry Smith bsmith at mcs.anl.gov
Mon Aug 22 11:32:14 CDT 2016


> On Aug 22, 2016, at 10:49 AM, Matthew Overholt <overholt at capesim.com> wrote:
> 
> Hi All,
>  
> I am using the Intel MKL CPardiso library as a PC direct solver, and I am trying to figure out how to properly set options (the Pardiso and CPardiso “iparm” parameter values in the Intel docs).
>  
> Q1: To set the Pivoting perturbation, for example, is the correct call:
> ierr = MatMkl_CPardisoSetCntl( K, 10, 13 );
> where the KSP matrix to be inverted is “K” and the value that I want is “13”?  This is the “-mat_mkl_pardiso_10” option listed on the MATSOLVERMKL_PARDISO page, and the “iparm[9]” option in the Intel docs.

  From the documentation: 

   Input Parameters:
+  F - the factored matrix obtained by calling MatGetFactor()

So it is not the matrix you pass to KSP, it is the factored matrix created inside the KSP; the problem is that there is no way to access this factored matrix when using KSP before the factorization takes place to change these values.

>  
> Q2: Where do I make this call, before “MatSetUp( K )”, at some point during the creation and setup of KSP, or after calling “PCFactorSetMatSolverPackage( pc, MATSOLVERMKL_CPARDISO )”?  I’ve tried many different combinations and none of them seem to work.
>  
> Since the effect of changing the pivoting perturbation may not be obvious, I also tried setting the number of OpenMP threads to use within Pardiso (icntl = 65, without the environmental variable MKL_NUM_THREADS present) and my setting was ignored (Pardiso defaulted to using the maximum number of cores present).

    The easy way to set these is via the options database so from the command line you can use -mat_mkl_cpardiso_<icntl> <ival> 
for example -mat_mkl_cpardiso_10 13  or in the code you can write PetscOptionsSetValue(NULL,"-mat_mkl_cpardiso_10","13"); make sure that you call the PetscOptionsSetValue() BEFORE you call KSPSetFromOptions().

   I am adding a note to manual page for this routine to make this clear.

  Barry

The MatMkl_CPardisoSetCntl() routines are only usable if you don't use KSP but use MatGetFactor() and MatLUFactorSymbolic() directly. I don't recommend this.


>  
> Thanks in advance,
> Matt Overholt
> 
> 	Virus-free. www.avast.com



More information about the petsc-users mailing list