[petsc-users] MatMumpsSetIcntl from Fortran

Alexander Grayver agrayver at gfz-potsdam.de
Thu Dec 1 01:50:27 CST 2011


Hong,

This should be enough to reproduce the problem:

   call KSPCreate(PETSC_COMM_WORLD,ksp,ierr);CHKERRQ(ierr)
   call 
KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN,ierr);CHKERRQ(ierr)
   call KSPSetType(ksp,KSPPREONLY,ierr);CHKERRQ(ierr)
   call KSPGetPC(ksp,pc,ierr);CHKERRQ(ierr)
   call PCSetType(pc,PCCHOLESKY,ierr);CHKERRQ(ierr)
   call PCFactorSetMatSolverPackage(pc,MATSOLVERMUMPS,ierr);CHKERRQ(ierr)
   call PCFactorSetUpMatSolverPackage(pc,ierr);CHKERRQ(ierr)
   call PCFactorGetMatrix(pc,F,ierr);CHKERRQ(ierr)
   call KSPSetFromOptions(ksp,ierr);CHKERRQ(ierr)
   icntl = 2; ival = 0;
   call MatMumpsSetIcntl(F,icntl,ival,ierr);

Regards,
Alexander

On 30.11.2011 23:43, Hong Zhang wrote:
>> Sorry if I wasn't clear.  "c" example works fine, I know, what I meant is
>> that if you try to implement lines 150-171 from it on FORTRAN you will see
>> the problem I reported.
>> If you need particularly my FORTRAN code I can send it tomorrow.
> This would save my time :-)
> Appreciate.
>
> Hong
>> Regards,
>> Alexander
>>
>>
>> ----- Reply message -----
>> From: "Hong Zhang"<hzhang at mcs.anl.gov>
>> To: "PETSc users list"<petsc-users at mcs.anl.gov>
>> Subject: [petsc-users] MatMumpsSetIcntl from Fortran
>> Date: Wed, Nov 30, 2011 9:37 pm
>>
>>
>> Alexander :
>>
>>> I just rewrote code concerning mumps from this example (lines 150-170):
>>>
>>> http://www.mcs.anl.gov/petsc/petsc-dev/src/ksp/ksp/examples/tutorials/ex52.c.html
>> Where is your Fortran code? ex52.c works fine.
>> Hong
>>
>>> On 30.11.2011 17:40, Hong Zhang wrote:
>>>> Alexander:
>>>>
>>>>> Has anybody tried to use MatMumpsSetIcntl from Fortran?
>>>> We are not aware of it.
>>>>
>>>>> Because when I try to call it I fall into infinite recursion in
>>>>> function:
>>>> Can you give me a short Fortran code that repeats this error for
>>>> investigating?
>>>> Meanwhile, you can use runtime option '-mat_mumps_icntl_xxx<>' to get
>>>> your code run.
>>>>
>>>> Hong
>>>>>   PetscErrorCode MatMumpsSetIcntl(Mat F,PetscInt icntl,PetscInt ival)
>>>>>   {
>>>>>    PetscErrorCode ierr;
>>>>>
>>>>>    PetscFunctionBegin;
>>>>>    PetscValidLogicalCollectiveInt(F,icntl,2);
>>>>>    PetscValidLogicalCollectiveInt(F,ival,3);
>>>>>    ierr =
>>>>>
>>>>>
>>>>> PetscTryMethod(F,"MatMumpsSetIcntl_C",(Mat,PetscInt,PetscInt),(F,icntl,ival));CHKERRQ(ierr);
>>>>>    PetscFunctionReturn(0);
>>>>>   }
>>>>>
>>>>> At the moment when program crashes call stack looks like:
>>>>>
>>>>>      __libc_memalign,
>>>>> FP=7fff342ca010
>>>>> PetscMallocAlign,                                        FP=7fff342ca080
>>>>> PetscTrMallocDefault,                                    FP=7fff342ca180
>>>>> PetscStrallocpy,                                         FP=7fff342ca230
>>>>> PetscFListGetPathAndFunction,                            FP=7fff342cb2e0
>>>>> PetscFListFind,                                          FP=7fff342cb520
>>>>> PetscObjectQueryFunction_Petsc,                          FP=7fff342cb590
>>>>> PetscObjectQueryFunction,                                FP=7fff342cb620
>>>>> MatMumpsSetIcntl,                                        FP=7fff342cb720
>>>>> MatMumpsSetIcntl,                                        FP=7fff342cb820
>>>>> MatMumpsSetIcntl,                                        FP=7fff342cb920
>>>>> MatMumpsSetIcntl,                                        FP=7fff342cba20
>>>>> MatMumpsSetIcntl,                                        FP=7fff342cbb20
>>>>> MatMumpsSetIcntl,                                        FP=7fff342cbc20
>>>>> MatMumpsSetIcntl,                                        FP=7fff342cbd20
>>>>> MatMumpsSetIcntl,                                        FP=7fff342cbe20
>>>>> MatMumpsSetIcntl,                                        FP=7fff342cbf20
>>>>> ... (Hundreds of MatMumpsSetIcntl) ...
>>>>>
>>>>> What can I do about that?
>>>>>
>>>>> Regards,
>>>>> Alexander
>>>



More information about the petsc-users mailing list