[petsc-users] a naive question about assembly

Matthew Knepley knepley at gmail.com
Mon May 5 20:18:27 CDT 2014


On Mon, May 5, 2014 at 8:14 PM, huaibao zhang <paulhuaizhang at gmail.com>wrote:

>
> Hello,
>
> I looked up the manual, but still felt  quite confused about why have to
> do assembly. Does it have to do with parallelization? Since all of the
> processors are loading the data at the same time, they need to a pause
> before one can use the whole vector?
>

If one process sets a value owned by another process, it has to tell it.

   Matt


> See a piece of code:
>
>                         for (int c=0;c<grid[gid].cellCount;++c) {
>                                 row=grid[gid].myOffset+c;
>                                 value=p;
>
> VecSetValues(soln_n,1,&row,&value,INSERT_VALUES);
>                         }
>                         VecAssemblyBegin(soln_n); VecAssemblyEnd(soln_n);
>
>
> Thanks,
> Paul
>



-- 
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/20140505/674e1d34/attachment.html>


More information about the petsc-users mailing list