On Fri, Mar 4, 2011 at 3:14 PM, M. Scot Breitenfeld <span dir="ltr">&lt;<a href="mailto:brtnfld@uiuc.edu">brtnfld@uiuc.edu</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 03/03/2011 12:18 PM, Matthew Knepley wrote:<br>
&gt; On Wed, Mar 2, 2011 at 4:52 PM, M. Scot Breitenfeld &lt;<a href="mailto:brtnfld@uiuc.edu">brtnfld@uiuc.edu</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:brtnfld@uiuc.edu">brtnfld@uiuc.edu</a>&gt;&gt; wrote:<br>
&gt;<br>
</div><div class="im">&gt;     I don&#39;t number my global degree&#39;s of freedom from low-high<br>
&gt;     continuously<br>
&gt;     per processor as PETSc uses for ordering, but I use the natural<br>
&gt;     ordering<br>
&gt;     of the application, I then use AOcreateBasic to obtain the mapping<br>
&gt;     between the PETSc and my ordering.<br>
&gt;<br>
&gt;<br>
&gt; I would suggest using the LocalToGlobalMapping functions, which are<br>
&gt; scalable.<br>
&gt; AO is designed for complete global permutations.<br>
</div>I don&#39;t understand how I can avoid not using AO if my global dof per<br>
processor are not arranged in PETSc global ordering (continuous row<br>
ordering, i.e. proc1_ 0-n, proc2_n+1:m, proc3_m+1:p, etc...). In the<br>
LocalToGlobalMapping routines, doesn&#39;t the &quot;GlobalMapping&quot; part mean<br>
PETSc ordering and not my application&#39;s ordering.<br>
<br>
I thought I understood the difference between AO and<br>
LocalToGlobalMapping but now I&#39;m confused. I tried to use the<br>
LocalToGlobalMapping routines and the solution values are correct but<br>
the ordering corresponds the global node ordering, not how I partitioned<br>
the mesh. In other words, the values are returned in the same ordering<br>
as for a serial run, which makes sense since this is how PETSc orders<br>
the rows. If I had used PETSc ordering then this would be fine.<br>
<br>
Is the moral of the story, if I want to get scalability I need to<br>
rearrange my global dof in PETSc ordering so that I can use<br>
LocalToGlobalMapping?</blockquote><div><br></div><div>I am having a really hard time understanding what you want? If you want Natural</div><div>Ordering or any other crazy ordering on input/output go ahead and use AO there</div>
<div>because the non-scalability is amortized over the run. The PETSc ordering should</div><div>be used for all globally assembled structures in the solve because its efficient, and</div><div>there is no reason for the user to care about these structures. For integration/assembly,</div>
<div>use local orderings since that is all you need for a PDE. If you have an exotic</div><div>equation that really does need global information, I would like to hear about it, but</div><div>it would most likely be non-scalable on its own.</div>
<div><br></div><div>    Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">
&gt;<br>
&gt;   Thanks,<br>
&gt;<br>
&gt;      Matt<br>
&gt;<br>
&gt;<br>
&gt;      CALL VecGetOwnershipRange(b, low, high, ierr)<br>
&gt;<br>
&gt;      icnt = 0<br>
&gt;<br>
&gt;      DO mi = 1, mctr ! these are the nodes local to processor<br>
&gt;            mi_global = myglobal(mi)<br>
&gt;<br>
&gt;            irowx = 3*mi_global-2<br>
&gt;            irowy = 3*mi_global-1<br>
&gt;            irowz = 3*mi_global<br>
&gt;<br>
&gt;            mappings(icnt+1:icnt+3) = (/            &amp;<br>
&gt;                 nrow_global(row_from_dof(1,mi))-1, &amp;<br>
&gt;                 nrow_global(row_from_dof(2,mi))-1, &amp;<br>
&gt;                 nrow_global(row_from_dof(3,mi))-1  &amp;<br>
&gt;                 /)<br>
&gt;<br>
&gt;            petscOrdering(icnt+1:icnt+3) =<br>
&gt;     (/low+icnt,low+icnt+1,low+icnt+2/)<br>
&gt;<br>
&gt;            icnt = icnt + 3<br>
&gt;      END DO<br>
&gt;<br>
&gt;      CALL AOCreateBasic(PETSC_COMM_WORLD, icnt, mappings, petscOrdering,<br>
&gt;     toao, ierr)<br>
&gt;<br>
&gt;      DO mi = mctr+1, myn ! these are the ghost nodes not on this processor<br>
&gt;<br>
&gt;         mi_global = myglobal(mi)<br>
&gt;<br>
&gt;         mappings(icnt+1:icnt+3) = (/            &amp;<br>
&gt;              nrow_global(row_from_dof(1,mi))-1, &amp;<br>
&gt;              nrow_global(row_from_dof(2,mi))-1, &amp;<br>
&gt;              nrow_global(row_from_dof(3,mi))-1  &amp;<br>
&gt;              /)<br>
&gt;<br>
&gt;         icnt = icnt + 3<br>
&gt;      ENDDO<br>
&gt;      CALL AOApplicationToPetsc(toao, 3*myn, mappings, ierr)<br>
&gt;<br>
&gt;      CALL AODestroy(toao, ierr)<br>
&gt;<br>
&gt;     I then use  mapping to input the values into the correct row as wanted<br>
&gt;     by PETSc<br>
&gt;<br>
&gt;<br>
&gt;     On 03/02/2011 04:29 PM, Matthew Knepley wrote:<br>
&gt;     &gt; On Wed, Mar 2, 2011 at 4:25 PM, M. Scot Breitenfeld<br>
&gt;     &lt;<a href="mailto:brtnfld@uiuc.edu">brtnfld@uiuc.edu</a> &lt;mailto:<a href="mailto:brtnfld@uiuc.edu">brtnfld@uiuc.edu</a>&gt;<br>
</div></div><div><div></div><div class="h5">&gt;     &gt; &lt;mailto:<a href="mailto:brtnfld@uiuc.edu">brtnfld@uiuc.edu</a> &lt;mailto:<a href="mailto:brtnfld@uiuc.edu">brtnfld@uiuc.edu</a>&gt;&gt;&gt; wrote:<br>
&gt;     &gt;<br>
&gt;     &gt;     Hi,<br>
&gt;     &gt;<br>
&gt;     &gt;     First, thanks for the suggestion on using MPISBAIJ for my A<br>
&gt;     matrix, it<br>
&gt;     &gt;     seems to have cut down on my memory and assembly time. For a 1.5<br>
&gt;     &gt;     million<br>
&gt;     &gt;     dof problem:<br>
&gt;     &gt;<br>
&gt;     &gt;        # procs:                  2        4        8           16<br>
&gt;     &gt;     ----------------------------------------------------------------<br>
&gt;     &gt;     Assembly (sec):        245     124      63       86<br>
&gt;     &gt;     Solver (sec):              924     578     326     680<br>
&gt;     &gt;<br>
&gt;     &gt;     Memory (GB):          2.5        1.4     .877    .565<br>
&gt;     &gt;<br>
&gt;     &gt;     The problem I have is the amount of time it&#39;s taking in<br>
&gt;     AOCreateBasic,<br>
&gt;     &gt;     it takes longer then assembling,<br>
&gt;     &gt;<br>
&gt;     &gt;        # procs:                            2        4        8<br>
&gt;           16<br>
&gt;     &gt;<br>
&gt;     ---------------------------------------------------------------------<br>
&gt;     &gt;     AOCreateBasic (sec):         .6      347      170     197<br>
&gt;     &gt;<br>
&gt;     &gt;     Is there something that I can change or something I can look<br>
&gt;     for that<br>
&gt;     &gt;     might be causing this increase in time as I go from 2 to 4<br>
&gt;     processors<br>
&gt;     &gt;     (at least it scales from 4 to 8 processors). I read in the<br>
&gt;     archive<br>
&gt;     &gt;     that<br>
&gt;     &gt;     AOCreateBasic is not meant to be scalable so maybe there is<br>
&gt;     nothing I<br>
&gt;     &gt;     can do.<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; Yes, this is non-scalable. What are you using it for?<br>
&gt;     &gt;<br>
&gt;     &gt;    Matt<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;     Thanks,<br>
&gt;     &gt;     Scot<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; --<br>
&gt;     &gt; What most experimenters take for granted before they begin their<br>
&gt;     &gt; experiments is infinitely more interesting than any results to which<br>
&gt;     &gt; their experiments lead.<br>
&gt;     &gt; -- Norbert Wiener<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; What most experimenters take for granted before they begin their<br>
&gt; experiments is infinitely more interesting than any results to which<br>
&gt; their experiments lead.<br>
&gt; -- Norbert Wiener<br>
<br>
</div></div></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>