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