[petsc-users] VecDot usage in parallel

Jed Brown jed at jedbrown.org
Thu May 8 09:11:11 CDT 2014

Zafer Leylek <Zafer.Leylek at student.adfa.edu.au> writes:

> I have recently started using petsc and have little experience with parallel programming.
> I am having problem with the following section of my code:
>         KSPGetPC(ksp,&pc);
>         PCSetType(pc,PCCHOLESKY);
>         PCFactorSetMatSolverPackage(pc,MATSOLVERMUMPS);
>         PCFactorSetUpMatSolverPackage(pc);
>         PCFactorGetMatrix(pc,&L);
>         MatMumpsSetIcntl(L,7,2);
>         MatMumpsSetCntl(L,1,0.0);
>         MatMumpsSetIcntl(L,33,1);
>         KSPSetUp(ksp);
>         KSPSolve(ksp, y, alpha);
>         VecDot(y, alpha, &sigma);
> when I run it using a single processor (mpiexec -np 1 ....) I get the
> correct answer, when I run using 2 processors I get sigma = 4*sigma
> and so on.

View y and alpha.  I suspect you are solving a different problem in
these cases.

VecDot computes the parallel dot product.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140508/60121c9a/attachment.pgp>

More information about the petsc-users mailing list