[petsc-users] HYPRE hanging or slow? from observation
Matthew Knepley
knepley at gmail.com
Sat Oct 21 16:25:02 CDT 2017
On Sat, Oct 21, 2017 at 5:21 PM, Hao Zhang <hbcbh1999 at gmail.com> wrote:
> ierr = MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY);
> ierr = MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY);
>
> ierr = VecAssemblyBegin(x);
> ierr = VecAssemblyEnd(x);
>
This is probably unnecessary
>
> ierr = VecAssemblyBegin(b);
> ierr = VecAssemblyEnd(b);
>
This is probably unnecessary
>
>
> ierr = MatNullSpaceCreate(PETSC_COMM_WORLD,PETSC_TRUE,0,PETSC_NULL,
> &nullsp);
> ierr = MatSetNullSpace(A,nullsp); // Petsc-3.8
>
Is your rhs consistent with this nullspace?
> // KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN);
> KSPSetOperators(ksp,A,A);
>
> KSPSetType(ksp,KSPBCGS);
>
> KSPSetComputeSingularValues(ksp, PETSC_TRUE);
> #if defined(__HYPRE__)
> KSPGetPC(ksp, &pc);
> PCSetType(pc, PCHYPRE);
> PCHYPRESetType(pc,"boomeramg");
>
This is terribly unnecessary. You just use
-pc_type hypre -pc_hypre_type boomeramg
or
-pc_type gamg
> #else
> KSPSetType(ksp,KSPBCGSL);
> KSPBCGSLSetEll(ksp,2);
> #endif /* defined(__HYPRE__) */
>
> KSPSetFromOptions(ksp);
> KSPSetUp(ksp);
>
> ierr = KSPSolve(ksp,b,x);
>
>
> command line
>
You did not provide any of what I asked for the in the eprevious mail.
Matt
> On Sat, Oct 21, 2017 at 5:16 PM, Matthew Knepley <knepley at gmail.com>
> wrote:
>
>> On Sat, Oct 21, 2017 at 5:04 PM, Hao Zhang <hbcbh1999 at gmail.com> wrote:
>>
>>> hi,
>>>
>>> I implemented HYPRE preconditioner for my study due to the fact that
>>> without preconditioner, PETSc solver will take thousands of iterations to
>>> converge for fine grid simulation.
>>>
>>> with HYPRE, depending on the parallel partition, it will take HYPRE
>>> forever to do anything. observation of output file is that the simulation
>>> is hanging with no output.
>>>
>>> Any idea what happened? will post snippet of code.
>>>
>>
>> 1) For any question about convergence, we need to see the output of
>>
>> -ksp_view_pre -ksp_view -ksp_monitor_true_residual -ksp_converged_reason
>>
>> 2) Hypre has many preconditioners, which one are you talking about
>>
>> 3) PETSc has some preconditioners in common with Hypre, like AMG
>>
>> Thanks,
>>
>> Matt
>>
>>
>>> --
>>> Hao Zhang
>>> Dept. of Applid Mathematics and Statistics,
>>> Stony Brook University,
>>> Stony Brook, New York, 11790
>>>
>>
>>
>>
>> --
>> What most experimenters take for granted before they begin their
>> experiments is infinitely more interesting than any results to which their
>> experiments lead.
>> -- Norbert Wiener
>>
>> https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
>>
>
>
>
> --
> Hao Zhang
> Dept. of Applid Mathematics and Statistics,
> Stony Brook University,
> Stony Brook, New York, 11790
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171021/c9bcd0a0/attachment-0001.html>
More information about the petsc-users
mailing list