<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, May 5, 2014 at 8:22 PM, huaibao zhang <span dir="ltr"><<a href="mailto:paulhuaizhang@gmail.com" target="_blank">paulhuaizhang@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>Matt,</div>
<div><br></div><div>THanks for the answer.</div>I think my question is why have to do assembly? <div><div>In the piece of my code, 2 processors are inserting the dada to a public vector soon_n.</div></div></div></blockquote>
<div><br></div><div>This is explained very well in the book Using MPI: <a href="http://www.mcs.anl.gov/research/projects/mpi/usingmpi/">http://www.mcs.anl.gov/research/projects/mpi/usingmpi/</a></div><div><br></div><div>If process 0 inserts a value for process 1, then somehow process 1 must be told. That happens in VecAssembly().</div>
<div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">
<div><div>Paul</div><div><br><div><br></div><div><br><div><div>On May 5, 2014, at 9:18 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br><blockquote type="cite">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, May 5, 2014 at 8:14 PM, huaibao zhang <span dir="ltr"><<a href="mailto:paulhuaizhang@gmail.com" target="_blank">paulhuaizhang@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><span style="white-space:pre-wrap">      </span><br>
<div>
<div style="font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">

<span style="font-size:12px">Hello,</span></div><div style="font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">

<span style="font-size:12px"><br></span></div><div style="text-align:-webkit-auto;text-indent:0px;word-wrap:break-word"><span style="font-size:12px">I looked up the manual, but still felt </span><span style="font-size:12px"> </span><span style="font-size:12px">quite confused about</span><span style="font-size:12px"> </span><span style="font-size:12px">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 </span><span style="font-size:12px">vector? </span></div>

</div></div></blockquote><div><br></div><div>If one process sets a value owned by another process, it has to tell it.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div style="word-wrap:break-word"><div style="font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">

<span style="font-size:12px">See a piece of code: </span></div><div style="font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">

<span style="font-size:12px"><br></span></div><div style="text-align:-webkit-auto;text-indent:0px;word-wrap:break-word"><div style="word-wrap:break-word"><span style="font-size:12px">                        for (int c=0;c<grid[gid].cellCount;++c) {</span></div>

<div style="word-wrap:break-word"><span style="font-size:12px">                                row=grid[gid].myOffset+c;</span></div></div><div style="text-align:-webkit-auto;text-indent:0px;word-wrap:break-word"><div style="word-wrap:break-word">

<span style="font-size:12px">                                value=p;</span></div><div style="word-wrap:break-word"><span style="font-size:12px">                                VecSetValues(soln_n,1,&row,&value,INSERT_VALUES);</span></div>

<div style="word-wrap:break-word"><span style="font-size:12px">                        }</span></div><div style="word-wrap:break-word"><span style="font-size:12px">                        VecAssemblyBegin(soln_n); VecAssemblyEnd(soln_n);</span></div>

<div style="word-wrap:break-word"><span style="font-size:12px"><br></span></div><div style="word-wrap:break-word"><span style="font-size:12px"><br></span></div><div style="word-wrap:break-word"><span style="font-size:12px">Thanks,</span></div>

<div style="word-wrap:break-word"><span style="font-size:12px">Paul</span></div></div></div></blockquote></div><br><br clear="all"><span class=""><font color="#888888"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>

-- Norbert Wiener
</font></span></div></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>