[petsc-users] Controlling MUMPS parameters inside PETSC

Hong hzhang at mcs.anl.gov
Fri Oct 13 21:00:49 CDT 2017


Evan:
When PCLU is requested, matrix is treated as unsymmetric by mumps and
petsc, thus the setting of id.sym=0 is actually used.

If user requests PCCholesky, then mumps needs to be set as sym.id=1 (spd)
or 2 (symmetric). In mumps interface, we do
#if defined(PETSC_USE_COMPLEX)
    mumps->sym = 2;
#else
    if (A->spd_set && A->spd) mumps->sym = 1;
    else                      mumps->sym = 2;
#endif

Hong

Hi Hong,
>
> Thanks for your reply. When I use standalone MUMPS for a symmetric matrix,
> I pass a upper/lower triangular part to MUMPS. To do this, I use id.sym=2.
> Under PETSC environment,
>
> KSPCreate(PETSC_COMM_WORLD, &ksp);
> KSPSetOperators(ksp, A, A);
> KSPSetType (ksp, KSPPREONLY);
> KSPGetPC(ksp, &pc);
> MatSetOption(A, MAT_SYMMETRIC, PETSC_TRUE);
> PCSetType(pc, PCLU);
> PCFactorSetMatSolverPackage(pc, MATSOLVERMUMPS);
> PCFactorSetUpMatSolverPackage(pc);
>
> Can the 5th line be an alternative to id.sym=2?
>
> Best,
> Evan
>
>
>
>
> On Fri, Oct 13, 2017 at 4:16 PM, Hong <hzhang at mcs.anl.gov> wrote:
>
>> Evan:
>>
>>> Dear PETSC-users,
>>>
>>> I use parallel direct solver MUMPS inside PETSC and need to control some
>>> MUMPS parameters inside PETSC. For example, I want to set up MUMPS
>>> parameters as shown below.
>>>
>>>  ZMUMPS_STRUC_C id;
>>>  id.job=-1; /* Initialize mumps instance*/
>>>
>> This is set in petsc/mumps interface. See line 1197, mumps.c
>>
>>
>>>  id.par=1;  /* 0: host is not involved in solution processes */
>>>
>>  id.par=1; is used in the interface. See line 1198, id.par=1;
>>
>>  id.sym=2;  /* 0:unsysm, 2:general symmetric matrix */
>>>
>> id.sym is set in the interface based on the input matrix type, see line
>> 2154-2171
>>
>>>
>>> How can I access structure similar to id in PETSC?
>>>
>> Why do you want access id?
>>
>>
>>> For example, I control my icntl parameters like this.
>>>
>>> PCFactorGetMatrix(pc, &F);
>>> MatMumpsSetIcntl(F, icntl[i], ival[i]);
>>>
>>> However, it is not clear about how to control id.par and id.sym. If you
>>> have any experience in controlling id.par and id.sym inside PETSC, I
>>> request your help. In advance, thank you  very much for your help.
>>>
>>
>> Petsc/mumps interface is developed for petsc users to call mumps direct
>> solvers under petsc environment. The parameters id.par, id.sym ... are set
>> in the interface according to the user's matrix and solver type, thus user
>> does not need to know about them.
>>
>> Hong
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171013/4636516d/attachment.html>


More information about the petsc-users mailing list