[petsc-users] HYPRE hanging or slow? from observation

Hao Zhang hbcbh1999 at gmail.com
Sat Oct 21 16:21:20 CDT 2017


ierr = MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY);
  ierr = MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY);

  ierr = VecAssemblyBegin(x);
  ierr = VecAssemblyEnd(x);

  ierr = VecAssemblyBegin(b);
  ierr = VecAssemblyEnd(b);


ierr = MatNullSpaceCreate(PETSC_COMM_WORLD,PETSC_TRUE,0,PETSC_NULL,&nullsp);
        ierr = MatSetNullSpace(A,nullsp); // Petsc-3.8

        // 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");
#else
KSPSetType(ksp,KSPBCGSL);
KSPBCGSLSetEll(ksp,2);
#endif /* defined(__HYPRE__) */

        KSPSetFromOptions(ksp);
        KSPSetUp(ksp);

        ierr = KSPSolve(ksp,b,x);


command line


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171021/4651cebc/attachment.html>


More information about the petsc-users mailing list