[Paraview] Ridiculously slow D3 (a bug in vtkMergeCells)

Takuya OSHIMA oshima at eng.niigata-u.ac.jp
Wed Sep 30 03:51:13 EDT 2009


Hi,

I have had a problem of ridiculously slow D3 of PV 3.6.1/3.7-cvs under
some conditions. Most of the time the problem occurs when I have more
pvserver processes than the number of data pieces, in which case D3
takes two orders of magnitude more time than usual, despite that the
resulting repartitioned dataset looks fine.

Attaching a performance analyzer (Apple's Shark) to the pvserver
processes revealed that, in one of the pvserver processes
vtkMergePoints::InsertUniquePoint() took up virtually all of the
processor time, as attached sharkOutput.jpg.

It further turned out that this is because the instance of
vtkMergePoints is given indeterminate bounds by its caller
vtkMergeCells::MapPointsToIdsUsingLocator() and hence hashing based on
relative point coordinates in the bounds is not working. Here is a
proposed fix to the problem (the comment "points0->GetNumberOfPoints()
is equal to..." was taken from about 50 lines below the patched lines
in the same function. I believe it explains everything.).

Index: vtkMergeCells.cxx
===================================================================
RCS file: /cvsroot/ParaView3/ParaView3/VTK/Graphics/vtkMergeCells.cxx,v
retrieving revision 1.9
diff -u -r1.9 vtkMergeCells.cxx
--- vtkMergeCells.cxx	23 Jan 2009 03:25:07 -0000	1.9
+++ vtkMergeCells.cxx	30 Sep 2009 06:47:09 -0000
@@ -723,7 +723,12 @@
     if (npoints0 > 0)
       {
       double tmpbounds[6];
+      // points0->GetNumberOfPoints() is equal to the upper bound 
+      // on the points in the final merged grid.  We need to temporarily 
+      // set it to the number of points added to the merged grid so far.
+      points0->GetData()->SetNumberOfTuples(npoints0);
       grid->GetBounds(tmpbounds);
+      points0->GetData()->SetNumberOfTuples(this->TotalNumberOfPoints);
 
       bounds[0] = ((tmpbounds[0] < bounds[0]) ? tmpbounds[0] : bounds[0]);
       bounds[2] = ((tmpbounds[2] < bounds[2]) ? tmpbounds[2] : bounds[2]);


Regards,
Takuya

Takuya OSHIMA, Ph.D.
Faculty of Engineering, Niigata University
8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sharkOutput.jpg
Type: image/jpeg
Size: 79112 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090930/f2a11122/attachment-0001.jpg>


More information about the ParaView mailing list