[petsc-dev] stencils, ex2f.F, openmp

Svetlana Tkachenko svetlana.tkachenko at fastmail.fm
Thu Nov 7 22:37:58 CST 2013



On Fri, 8 Nov 2013, at 14:31, Gryllida wrote:
> 
> 
> On Fri, 8 Nov 2013, at 14:08, Gryllida wrote:
> > 
> > 
> > On Fri, 8 Nov 2013, at 10:09, Svetlana Tkachenko wrote:
> > > ex2f.F involves a band matrix with 4 on main diagonal and -1s on the sub-diagonals. I have A_central matrix which stores the -4s, and A_left, A_right, Atop, A_bottom matrices which store the -1s (they actually are more complicated numbers than that). Would it be recommended to simply wrap the "do 10, II=..." block like the one in ex2f.F into $OMP DO to speed up filling of the matrix as each of the values set can be set independently of others? (I tried doing so but got a segmentation fault and I'm working on a small example to reproduce the problem.)
> > > 
> > >   Svetlana
> > 
> > I figured out this is called 'stencils' correctly and corrected the subject.
> > Trying to use example ex22f.F but it's quite involved.
> > 
> >   Svetlana
> 
> Found http://scicomp.stackexchange.com/questions/2224/how-should-i-build-a-2d-5-point-stencil-laplacian-matrix-in-parallel/2228 and will try to follow Jed Brown's advice.

(Again I wrote from the wrong e-mail. This should be fixed now.)

The example has a line to compute matrix A from Ax = b, and a line to compute source term (vector b).

> call KSPSetComputeOperators(ksp,ComputeMatrix,ctx,ierr)
> call KSPSetComputeRHS(ksp,ComputeRHS,ctx,ierr)

What do I use to give it the initial guess on x?

  Svetlana



More information about the petsc-dev mailing list