Oops, my bad! I missed the original patch I sent skipped reading data
on other processes even in the multi-grid case. I've pushed a fix.
Attached is the corrected patch (start with a clean version of Xdmf
w/o the previous patch).

Utkarsh

On Wed, Aug 17, 2011 at 11:38 AM, Paul Melis <[email protected]> wrote:
> Hi Utkarsh,
>
> On 08/16/2011 06:22 PM, Utkarsh Ayachit wrote:
>> If you're writing out data that is already partitioned, you should
>> write it out as a collection of grids. Then each grid in that
>> collection is read on a separate partition.
>
> I followed your advice, but seem to have hit on another bug, this time
> with nodes not reading/showing their collection. See the attached Xdmf
> file, it contains a temporal collection of spatial collections, where
> there is actually only 1 timestep as it shows the incorrect behaviour.
> Each spatial grid consists of 16 unstructured grids, read from 16 HDF5
> files.
>
> The behaviour I'm seeing when loading this dataset on an 8-process PV
> session is that only 1/8th of the data actually shows up. Looking at the
> process Id scalars it only has a range of [0,0] and only 1 out of 8 of
> the "hypercolumn-?" sets in the multi-block set show any cells and
> points. This is with PV patched with the code you sent earlier, btw.
> Loading the same set on a local PV session works fine.
>
> I can upload the corresponding HDF5 files, if needed, but these are not
> public I'm afraid.
>
> Regards,
> Paul
>
>
diff --git a/vtk/vtkXdmfHeavyData.cxx b/vtk/vtkXdmfHeavyData.cxx
index 8aeebb4..1944fb0 100644
--- a/vtk/vtkXdmfHeavyData.cxx
+++ b/vtk/vtkXdmfHeavyData.cxx
@@ -83,6 +83,12 @@ vtkDataObject* vtkXdmfHeavyData::ReadData()
 {
   if (this->Domain->GetNumberOfGrids() == 1)
     {
+    // There's just 1 grid. Now in serial, this is all good. In parallel, we
+    // need to be care:
+    // 1. If the data is structured, we respect the update-extent and read
+    //    accordingly.
+    // 2. If the data is unstructrued, we read only on the root node. The user
+    //    can apply D3 or something to repartition the data.
     return this->ReadData(this->Domain->GetGrid(0));
     }
 
@@ -431,6 +437,17 @@ vtkDataObject* vtkXdmfHeavyData::ReadUnstructuredGrid(XdmfGrid* xmfGrid)
   vtkSmartPointer<vtkUnstructuredGrid> ugData =
     vtkSmartPointer<vtkUnstructuredGrid>::New();
 
+  // BUG #12527. For non-partitioned data, don't read unstructured grid on
+  // process id > 0.
+  if (this->Piece != 0 &&
+    this->Domain->GetNumberOfGrids() == 1 &&
+    this->Domain->GetVTKDataType() == VTK_UNSTRUCTURED_GRID &&
+    this->Domain->GetSetsSelection()->GetNumberOfArrays() == 0)
+    {
+    ugData->Register(NULL);
+    return ugData;
+    }
+
   XdmfTopology* xmfTopology = xmfGrid->GetTopology();
   XdmfArray* xmfConnectivity = xmfTopology->GetConnectivity();
 
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to