<div dir="ltr">I'm unclear on how to work with this if I don't specify the local extent.  In my code I am subdividing my computational domain so the data is unique on each processor, doing work and then dumping the results.  It is completely distributed and the processors don't share any data except on the boundaries.  I already know the global and local extents and now I need the local extent in the pvts to line up with the other portions of my code.  I don't want the pipeline to give me the local extent unless I can get it to match the extent I've already specified.<div><br></div><div> At this point, it is almost seeming easier to write a script that writes the *pvts for me instead of using the pipeline, but it frustrates me that I can't get the pipeline to do what I want. I'm trying to learn VTK in a broad sense in my spare time. However, for this specific problem the only thing I need is for the PVTS file to have the LocalExtents match my datasets on each of the processors. If I can just solve this all of my problems will be over. I am still wrapping my head around the pipeline concept, but it has been a struggle since there aren't many examples for the problem I'm trying to work with.  I'm actually not doing any rendering. I'm just managing IO.<div><br></div><div>I looked at the source you mentioned, but I'm not sure where I am supposed to interact with the RequestInformation request. I'm assuming it will be in the filter that is the input to vtkXMLPStructuredGridWriter, but I haven't really worked with any filters since I've only been doing IO.  With the programmable filter <a href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=IO/ParallelXML/Testing/Python/testParallelXMLWriters.py">example</a>, I can get it to write local extents that differ from the WholeExtent but they do not match my datasets. (In this case I just copied the execute function).</div><div><div><br></div></div><div>Also, I don't really see why it is necessary to specify the WholeExtent in RequestInformation.  I can specify the WholeExtent via vtkStructuredGrid.SetDimensions(), or SetExtent and it works fine.  It's just that the LocalExtents aren't correct. I think I'm really hitting a roadblock because I don't understand how the parallel writer and the partitioning works with the pipeline.</div><div><br></div><div>Can you provide some specifics on how the partitioning is supposed to work and/or help me modify the code in my previous example to do what I'm looking for? Either that or specify an open source code that has implemented vtkXMLPStructuredGridWriter that I can review.  My application is a CFD solver and it's post processing routines.</div><div><div><br></div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 19, 2016 at 7:18 AM, Andy Bauer <span dir="ltr"><<a href="mailto:andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</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">You need to specify the WholeExtent in the RequestInformation request.You actually don't specify the local extent, the pipeline will give you that for a source. I'd recommend looking at the Imaging/Core/<wbr>vtkRTAnalyticSource.cxx class in VTK to see how it's done as a source.<br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 18, 2016 at 1:16 AM, Philip Sakievich <span dir="ltr"><<a href="mailto:psakievich@gmail.com" target="_blank">psakievich@gmail.com</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">Andy and community,<div><br></div><div>I have read about the concept of whole extent vs extent, but the one thing I don't seem to be able to determine is how to set the  whole extent to be different.  I tried using vtkStructuredGrid.Crop() but nothing is happening.</div><div><br></div><div>In the code snippet below, I have previously declared points local to each processor.  I now want to populate a structured grid and write a *pvts that ties them all together.  When I run this code the pvts writes itself and the files, but they all have the same whole extent and extent.  Nothing is cropped to the desired local extent.  What am I doing wrong?  How do I specify a whole extent that is uniform across all processors, and a local extent that is specific to each one? </div><div><br></div><div><div>#create grid and filter for processing to writer</div><div>pf=vtk.vtkProgrammableFilter()</div><div>sg=vtk.vtkStructuredGrid()</div><div><br></div><div>#set extent global</div><div>sg.SetExtent(0,15,0,32,0,15)</div><div><br></div><div>#set extent local</div><div>if rank==0:</div><div>   lE=np.array([0,8,0,32,0,8],dt<wbr>ype=int)</div><div>   sg.Crop(lE)</div><div>if rank==1:</div><div>   lE=np.array([0,8,0,32,7,15],d<wbr>type=int)</div><div>   sg.Crop(lE)</div><div>if rank==2:</div><div>   lE=np.array([7,15,0,32,0,8],d<wbr>type=int)</div><div>   sg.Crop(lE)</div><div>if rank==3:</div><div>   lE=np.array([7,15,0,32,7,15],<wbr>dtype=int)</div><div>   sg.Crop(lE)</div><div><br></div><div>sg.SetPoints(pnts)</div><div>pf.SetInputData(sg)</div><div><br></div><div>writer=vtk.vtkXMLPStructuredGr<wbr>idWriter()</div><div>writer.SetInputConnection(pf.G<wbr>etOutputPort())</div><div>writer.SetController(contr)</div><div>writer.SetDataModeToAscii()</div><div>writer.SetFileName('testgrid.p<wbr>vts')</div><div>writer.SetNumberOfPieces(nrank<wbr>s)</div><div>writer.SetStartPiece(rank)</div><div>writer.SetEndPiece(rank)</div><div>writer.Write()</div></div><div><br></div><div>Thanks,</div><div><br></div><div>Phil</div></div><div class="m_-8653393100804381657HOEnZb"><div class="m_-8653393100804381657h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 13, 2016 at 7:31 AM, Andy Bauer <span dir="ltr"><<a href="mailto:andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</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"><div><div><div><div>Hi,<br><br></div>I would recommend using the pvts format since that is the best format for storing structured grids. If you read it back in it will know how to properly partition the data set for different amounts of processes as well as do things like ghost cells, extract surfaces, etc.<br><br></div>For topologically structured grids like vtkStructuredGrid there are two types of extents, "whole extent" describes the beginning and ending node (inclusive) in each direction for the entire grid while "extent" refers to each process's (or pieces if you're serial but doing streaming) partition of the grid. I believe this should be explained in the VTK User's Guide which is now available for free as a pdf download. <br><br></div>Cheers,<br></div>Andy<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-8653393100804381657m_-6206546010799080445h5">On Tue, Dec 13, 2016 at 10:21 AM, Philip Sakievich <span dir="ltr"><<a href="mailto:psakievich@gmail.com" target="_blank">psakievich@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-8653393100804381657m_-6206546010799080445h5"><div dir="ltr"><div>Greetings,</div><div><br></div><div>I am reasonably new to vtk and I am mainly using it to manage datasets on structured grids.</div><div><br></div>I am trying to write data for a structured grid in parallel python via MPI.  Each process has a separate portion of the grid, and I'm trying to figure out how to set up the write process. I was following this example:<div><br></div><div><a href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=IO/ParallelXML/Testing/Python/testParallelXMLWriters.py" target="_blank">http://www.vtk.org/gitweb?p=VT<wbr>K.git;a=blob;f=IO/ParallelXML/<wbr>Testing/Python/testParallelXML<wbr>Writers.py</a></div><div><br></div><div>But then I realized that in this case each process has the entire grid, and each processor is just writing a portion of the data it contains.  So do I need to use a multiblock data set?  Can someone please provide a simple example of how to write a structured grid in parallel provided each process has the local extent correctly specified? </div><div><br></div><div>Thanks<span class="m_-8653393100804381657m_-6206546010799080445m_3999332338089669960HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div class="m_-8653393100804381657m_-6206546010799080445m_3999332338089669960m_3902007003167008255gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Phil Sakievich</div><div><br></div><div><div>PhD Candidate - Mechanical Engineering</div><div>Arizona State University - Ira A. Fulton School for Engineering of Matter Transport and Energy<br>Tempe, Arizona</div></div></div></div></div></div>
</font></span></div></div>
<br></div></div>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-8653393100804381657m_-6206546010799080445gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Phil Sakievich</div><div><br></div><div><div>PhD Candidate - Mechanical Engineering</div><div>Arizona State University - Ira A. Fulton School for Engineering of Matter Transport and Energy<br>Tempe, Arizona</div></div></div></div></div></div>
</div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Phil Sakievich</div><div><br></div><div><div>PhD Candidate - Mechanical Engineering</div><div>Arizona State University - Ira A. Fulton School for Engineering of Matter Transport and Energy<br>Tempe, Arizona</div></div></div></div></div></div>
</div>