[petsc-users] Questions about ASM in petsc4py

Matthew Knepley knepley at gmail.com
Mon Mar 14 14:02:14 CDT 2016


On Mon, Mar 14, 2016 at 12:58 PM, Chih-Hao Chen <
chih-hao.chen2 at mail.mcgill.ca> wrote:

> Hell Matt,
>
> Thanks for the information.
> I am still trying it now.
> But I observed an interesting thing about the performance difference when
> running ex8.c about the ASM.
> When using Mvapich2 for mph, its convergence speed is much faster than
> OpenMPI.
> Is it becasue the ASM function has been optimized based on Mvapich2?
>

No, it is probably because you have a different partition on the two cases.
For performance questions, we
need to see the output of -log_summary for each case.

  Thanks,

    Matt


> Thanks very much.
>
>
> Best,
> Chih-Hao
>
> On Mar 10, 2016, at 4:28 PM, Matthew Knepley <knepley at gmail.com> wrote:
>
> On Thu, Mar 10, 2016 at 3:23 PM, Chih-Hao Chen <
> chih-hao.chen2 at mail.mcgill.ca> wrote:
>
>> Hello PETSc members,
>>
>>
>> Sorry for asking for help about the ASM in petsc4py.
>> Currently I am using your ASM as my preconditioned in my solver.
>> I know how to setup the PCASM based on the ex8.c in the following link.
>>
>> http://www.mcs.anl.gov/petsc/petsc-3.4/src/ksp/ksp/examples/tutorials/ex8.c
>>
>> But when using the function “getASMSubKSP” in petsc4py,
>> I have tried several methods, but still cannot get the subksp from each
>> mpi.
>>
>
> The subKSPs do not have to do with MPI. On each rank, you get the local
> KSPs.
>
>
>> Here is the snippet of the code of the function.
>>
>> def getASMSubKSP(self):        cdef PetscInt i = 0, n = 0        cdef PetscKSP *p = NULL        CHKERR( PCASMGetSubKSP(self.pc, &n, NULL, &p) )        return [ref_KSP(p[i]) for i from 0 <= i <n]
>>
>>
>> In ex8.c, we could use a “FOR” loop to access the indiivdual subksp.
>> But in python, could I use “FOR” loop to get all the subksps with:
>>
>> subksp[i] = pc.getASMSubKSP[i]
>>
>
> I do not understand this, but I think the answer is no.
>
>
>> Another question is in ex8.c, it seems I don’t need to do any setup to
>> decompose the RHS vector.
>> But do I need to decompose the RHS vector with any settings if I don’t
>> use PETSc solvers but with your preconditioners?
>>
>
> I do not understand what you mean by "decompose the RHS vector".
>
>   Thanks,
>
>     Matt
>
>
>> Thanks very much.
>>
>> Best,
>> Chih-Hao
>>
>>
>>
>
>
> --
> 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
>
>
>


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


More information about the petsc-users mailing list