[vtkusers] Existing data parallel example in contrib director
Jim Ahrens
ahrens at lanl.gov
Tue Aug 1 17:44:57 EDT 2000
There has been some confusion about data parallelism in vtk. Hopefully
the message below helps to clarify this issue.
The example program ParallelIso.cxx found in the contrib directory is an
example of a data parallel program. Multiple processes each create a
pipeline to read, isosurface and color a medical dataset. The resulting
polydata from each process is sent over an output port to process 0.
These datasets are received (by a set of input ports) on process 0 and
appended together using the vtkAppendPolyDataFilter and then rendered.
Partitioning of the data into independent subsets starts with the
vtkAppendPolyData filter. The call to app->ParallelStreamingOn() in the
ParallelIso.cxx program will cause
each process to request a subset of the isosurface polydata (i.e. piece
0 of 4, piece 1 of 4, etc.). The specific code and line that does this
can be found in graphics/vtkAppendPolyData.cxx in the method
ComputeInputUpdateExtents():
this->Input[idx]->SetUpdateExtext(piece + idx, numPieces);
When an update request is propagated up the pipeline (from the renderer,
to the append filter, through the elevation filter, to the isosurface
filter) the request for a
subset of polydata is translated into a request for an independent
subset/block
of the structured point input dataset. The specific code that does this
can be found in patented/vtkSynchronizedTemplates3D.cxx in the
method ComputeInputUpdateExtents().
The result of the program is a surface (the skin/face of a patient)
colored uniquely
by the process id that generated it (i.e. the resulting face has a
colored
checkboard pattern on it).
Running this example in parallel with multiple processes should speedup
the reading, isosurfacing and coloring filters of the program. (One
caveat, too many processes can cause performance problems, for example,
too many readers may overwhelm the file system). If you have question on
this, please post back to the list and let's continue this thread.
--Jim
More information about the vtkusers
mailing list