[vtkusers] Parallel File Formats

Greg Novak novak at ucolick.org
Sun Nov 23 18:53:23 EST 2003


I have to admit that I'm failing to grok VTK's parallel XML file formats.  
I bought the book, read the online documentation, searched the mailing 
list, and grepped through the examples directories.  Still don't 
understand.

I have an existing program written using MPI and I would like to add a
function that writes data in VTK format to pull into Paraview or another
program.  My data is already partitioned among the processes and I've
already started all the processes with mpirun.  I just want each process 
to write its own data, and some process to write the "summary" file.  What 
do I do?

All attempts to call methods from vtkXMLPDataSetWriter result in a summary 
file that references (for example) file0.vti and file1.vti, but only 
file0.vti exists and both processes try to write to it.  I've played 
around with specifying the extents of both datasets to no avail.

At this point the only way I can get this to work is to have each process 
write a plain old serial file with a different filename, and then write 
the summary file "by hand" myself (ie, no calls to VTK methods) that 
references all the files.

To summarize:  Process 0 has a vtkDataSet of image data covering the 
extent (0 n 0 n 0 n/2), process 1 has a vtkDataSet of image data covering 
the extent (0 n 0 n n/2+1 n).  The two processes are already communicating 
with explicit calls to MPI that I wrote (if VTK is using MPI, it's doing 
so behind my back.  I haven't as far as I know provided any explicit 
instructions for it to do so).  I want to write a parallel data file.

What next?  I'd appreciate example code in any language, but I'm using C++ 
at the moment.

Thanks a lot,
Greg




More information about the vtkusers mailing list