[vtkusers] Different behavior of vtkXMLPUnstructuredGridWriter in VTK 7.1

Andy Bauer andy.bauer at kitware.com
Tue Dec 6 11:12:39 EST 2016

Hi John,

The issue is indeed due to changes that I mentioned before (i.e. only data
sets that have data get written out and the .pvtu file is adjusted
accordingly). With this change though interprocess communication is
required which is done the the
vtkMultiProcessController::GetGlobalController() object which essentially
acts as MPI_COMM_WORLD within VTK. You need to create a vtkMPIController
which derives from vtkMultiProcessController. See the attached files for
how that is done. This should also be backwards compatible but if it isn't,
please let us know.


ps. Ignore the ADIOS stuff in there (it's commented out). I was trying to
do two things at once and that's why the ADIOS stuff is in the

On Mon, Dec 5, 2016 at 6:06 PM, John Peterson <jwpeterson at gmail.com> wrote:

> On Mon, Dec 5, 2016 at 12:45 PM, Andy Bauer <andy.bauer at kitware.com>
> wrote:
>> Beyond this I can't think of any change off the top of my head that would
>> cause your issue. I looked at the repo but can't figure out the VTK
>> configurations from that. If you can share a simple test case which
>> demonstrates the issue I may be able to easily diagnose it.
> Here's a standalone test code that reproduces the issue for me:
> https://gist.github.com/jwpeterson/92f4b8422d6fbb1056e848c9b14ee1d7
> Run on two procs with: mpiexec -np 2 and I get the following test.pvtu
> file:
> <?xml version="1.0"?>
>> <VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian"
>> header_type="UInt32" compressor="vtkZLibDataCompressor">
>>   <PUnstructuredGrid GhostLevel="1">
>>     <PPointData>
>>       <PDataArray type="Float64" Name="u"/>
>>     </PPointData>
>>     <PCellData>
>>       <PDataArray type="Int32" Name="elem_id"/>
>>       <PDataArray type="Int32" Name="subdomain_id"/>
>>       <PDataArray type="Int32" Name="processor_id"/>
>>     </PCellData>
>>     <PPoints>
>>       <PDataArray type="Float64" Name="Points" NumberOfComponents="3"/>
>>     </PPoints>
>>     <Piece Source="test_0.vtu"/>
>>   </PUnstructuredGrid>
>> </VTKFile>
> As you can see, only one "Piece Source" is listed, but the output of the
> program is actually all 3 files (test.pvtu, test_0.vtu, test_1.vtu) and
> both the _0 and _1 files have nodes in them.  Furthermore, if I simply add
> a second "Piece Source" line corresponding to "test_1.vtu", the whole thing
> opens up just fine in Paraview.  I am a novice VTK programmer so it's very
> possible I'm doing something wrong, but this code definitely worked in VTK
> 6.x, and 7.0.
> Thanks for your help,
> John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161206/c913951e/attachment.html>
-------------- next part --------------
cmake_minimum_required(VERSION 2.8)


find_package(VTK REQUIRED)

find_package(MPI REQUIRED)
include_directories(SYSTEM ${MPI_C_INCLUDE_PATH})

add_executable(TestWriter MACOSX_BUNDLE vtk_test.C)

  target_link_libraries(TestWriter ${VTK_LIBRARIES})
  target_link_libraries(TestWriter vtkIOParallelXML vtkParallelMPI)


#find_package(ADIOS 1.11 REQUIRED)
#include_directories(SYSTEM ${ADIOS_INCLUDE_DIRS})

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtk_test.C
Type: text/x-csrc
Size: 4987 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161206/c913951e/attachment.c>

More information about the vtkusers mailing list