<div class="gmail_quote">On Wed, Sep 21, 2011 at 00:52, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Custom MPI_Datatypes allow you to put stuff whereever you want? Right?</blockquote></div><br><div>Yes, but they specify the base type. So you can read and write from a sparse subset of an array, but you have to know that it's an array of double when you create it. You can't reuse the same sparse distribution for ints. This means that if the information is only encoded in a MPI_Datatype, then we can't amortize the setup and memory costs by having one scatter that can move both.</div>
<div><br></div><div>Maybe that's okay, but it means that the PETSc object would need to either (a) make on of these thingies for every known type, (b) keep the index arrays around, or (c) make a new MPI_Datatype from an existing MPI_Datatype in which the layout is preserved, but the atom is changed.</div>
<div><br></div><div>None of these get around duplicating the memory to hold the layout within the MPI stack.</div>