<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 19, 2017 at 6:56 PM, Manuel Valera <span dir="ltr"><<a href="mailto:mvalera@mail.sdsu.edu" target="_blank">mvalera@mail.sdsu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I've read some more and from the ex13f90aux from the dm examples, it seems is very similar what im looking for, it says:<div><br></div><div><div> !</div><div> ! The following 4 subroutines handle the mapping of coordinates. I'll explain</div><div> ! this in detail:</div><div> ! PETSc gives you local arrays which are indexed using the global indices.</div><div> ! This is probably handy in some cases, but when you are re-writing an</div><div> ! existing serial code and want to use DMDAs, you have tons of loops going</div><div> ! from 1 to imax etc. that you don't want to change. </div><div> ! These subroutines re-map the arrays so that all the local arrays go from</div><div> ! 1 to the (local) imax. </div><div> !</div><div><br></div><div>Could someone explain a little bit more about these functions? petsc_to_local(), local_to_petsc(), and specially why are used transform_petsc_us() and transform_us_petsc() ?</div></div></div></blockquote><div><br></div><div>This is one way to do things, which I do not necessarily agree with. The larger point is that a scalable strategy is one</div><div>where you only compute over patches rather than the whole grid. This is usually trivial since the global bounds just</div><div>become local bounds, and you are done.</div><div><br></div><div>With DMDA, we are always using global indices so no problem for translating anything with global indices. However,</div><div>in parallel you should note that you can only refer to values on your owned patch of the grid.</div><div><br></div><div>I hope this answers the question. If not, can you try and explain more about what is not clear?</div><div><br></div><div> Thanks,</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 dir="ltr"><div><div>Thanks,</div><div><br></div><div>Manuel</div></div></div><div class="m_-8937653576248050637HOEnZb"><div class="m_-8937653576248050637h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 19, 2017 at 2:01 PM, Manuel Valera <span dir="ltr"><<a href="mailto:mvalera@mail.sdsu.edu" target="_blank">mvalera@mail.sdsu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello all,<div><br></div><div>I'm currently pushing forward on the parallelization of my model, next step would be to parallelize all the grids (pressure, temperature, velocities, and such), and they are stored as 3d arrays in fortran.</div><div><br></div><div>I'm following ex11f90.f and is a good start, i have a couple questions from it:</div><div><ol><li>in the example a dummy vector g is made and the array values are loaded into it, the dimensions of this vector are variable? the same dummy vector is used for 1d,2d,3d so i guess it is. i was planning to use matrix objects for 3d arrays but i guess a vector of this kind would be better suited?</li><li>I notice also that a stride is used from the corners of the DMDA, im looking for a way to operate over the global indices of the array instead, can this be done? any good example to follow on this? this would save us lots of effort if we can just extend the actual operations from global indices into the DMDA objects.</li><li>next, im concerned about the degrees of freedom, how can i know how many dof my model has? we are following an arakawa c-type grid. Same for the type of stencil which i guess is star type in my case, we use a 9 point stencil.</li></ol><div><br></div></div><div>that is it for now, thanks for your time,</div><div><br></div><div>Manuel Valera</div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-8937653576248050637gmail_signature" data-smartmail="gmail_signature">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></div>