I believe this should work since they have the same overlap size. The stencil shape<br>should only determine the scatter.<br><br> Matt<br><br><div class="gmail_quote">On Wed, Apr 22, 2009 at 7:26 PM, Shao-Ching Huang <span dir="ltr"><<a href="mailto:schuang@ats.ucla.edu">schuang@ats.ucla.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
I am trying to use DA type "STENCIL_STAR" for matrix solve, while<br>
using DA type "STENCIL_BOX" for some auxiliary operations.<br>
<br>
My question is: is the following sequence of operations valid<br>
(especially step 3 below):<br>
<br>
1. create two DA's, one with DA_STENCIL_STAR and the other with<br>
DA_STENCIL_BOX:<br>
<br>
DA da1, da2;<br>
DACreate3d(..., DA_STENCIL_STAR, ... , &da1);<br>
DACreate3d(..., DA_STENCIL_BOX, ..., &da2);<br>
<br>
(All other parameters of the two DA's are identical, on all<br>
processors.)<br>
<br>
2. Create a global vector "x1" associated with "da1" (STENCIL_STAR):<br>
<br>
Vec x1;<br>
Mat A;<br>
DACreateGlobalVector(da1, &x1);<br>
...<br>
DAGetMatrix(da1,..., &A);<br>
... (compute RHS, requiring STENCIL_STAR) ...<br>
... (solve matrix) ...<br>
<br>
3. Scatter global vector "x1" onto a local vector "y2", which is<br>
assocoated with da2 (STENCIL_BOX):<br>
<br>
Vec y2;<br>
DAGetLocalVector(da2, &y2);<br>
DAGlobalToLocalBegin(da1, x1, INSERT_VALUES, y2);<br>
DAGlobalToLocalEnd (da1, x1, INSERT_VALUES, y2);<br>
... (operations on y2, requiring STENCIL_BOX) ...<br>
<br>
<br>
The main reason to use "da1" (STENCIL_STAR) for matrix solve is that<br>
it introduces much less number of entries per row (9 in STENCIL_STAR<br>
vs. 27 in STENCIL_BOX). All operations on "x1" only require<br>
STENCIL_STAR. The computation on "y2" (requiring STENCIL_BOX) is only<br>
a small fraction of the entire code.<br>
<br>
Thanks,<br><font color="#888888">
<br>
Shao-Ching<br>
</font></blockquote></div><br><br clear="all"><br>-- <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<br>