<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><div>Hi,</div><div>I am running src/ksp/ksp/examples/tutorials/ex22.c</div><div>I matched the output of single processor and multiprocessor results and it works fine.</div><div>But I want to use a periodic boundary condition. I make the following changes in the main function and this works fine with this change as well:</div><div><br></div><div><div> ierr = DMMGCreate(PETSC_COMM_WORLD,1,PETSC_NULL,&dmmg);CHKERRQ(ierr);</div><div> ierr = DACreate3d(PETSC_COMM_WORLD,DA_XYZPERIODIC,DA_STENCIL_STAR,10,10,2,PETSC_DECIDE,PETSC_DECIDE,PETSC_DECIDE,1,1,0,0,0,&da);CHKERRQ(ierr);</div><div><br></div><div><br></div><div>However, when I comment out these following lines since I am using a PBC, then the result of 1 proc and multi-proc are not the same. They vary within 5 decimal points and
the difference increases with increasing number of processors. </div><div><br></div><div>/* if (i==0 || j==0 || k==0 || i==mx-1 || j==my-1 || k==mz-1){</div><div><div> v[0] = 2.0*(HxHydHz + HxHzdHy + HyHzdHx);</div><div> ierr = MatSetValuesStencil(B,1,&row,1,&row,v,INSERT_VALUES);CHKERRQ(ierr);</div><div> } else */</div><div><br></div><div>Could you please tell me what is going wrong here.</div><div><br></div><div>Thanks.</div></div></div><div style="position:fixed"></div>
</div></body></html>