[petsc-users] VecDot usage in parallel
Zafer Leylek
Zafer.Leylek at student.adfa.edu.au
Thu May 8 08:45:05 CDT 2014
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.
How can I solve this problem??
ZL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140508/e389beab/attachment.html>
More information about the petsc-users
mailing list