[petsc-users] Questions about ASM in petsc4py

Chih-Hao Chen chih-hao.chen2 at mail.mcgill.ca
Wed Mar 16 10:51:21 CDT 2016


Hello Matt,


Thanks for the information.
After using -log_summary to print out for both cases, I found both of them(openMpi and Mvapich2) give same performance.

On the other hand, I still cannot get clear ideas how to get the returned subKsps by the function of  getASMSubKSP.
It seems the return subKsp are saved in a list of KSP objects.
So I used :

subksp = pc.getASMSubKsp()
subksp[0].setType(‘richardson')
subksp[1].setType(‘richardson’)

with 2 processors.
But it showed "list index out of range”.

As you said on each rank, I can get the local KSPs.
Would you mind telling me how to get them?
Thanks very much.


Best,
Chih-Hao

On Mar 14, 2016, at 3:02 PM, Matthew Knepley <knepley at gmail.com<mailto:knepley at gmail.com>> wrote:

On Mon, Mar 14, 2016 at 12:58 PM, Chih-Hao Chen <chih-hao.chen2 at mail.mcgill.ca<mailto: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<mailto:knepley at gmail.com>> wrote:

On Thu, Mar 10, 2016 at 3:23 PM, Chih-Hao Chen <chih-hao.chen2 at mail.mcgill.ca<mailto: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/20160316/c6861a90/attachment-0001.html>


More information about the petsc-users mailing list