<HTML>
<HEAD>
<TITLE>Re: [Paraview] Ridiculously slow D3 (a bug in vtkMergeCells)</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>I would recommend submitting a bug report to make sure we don’t forget about this. Make sure you attach your patch to the report.<BR>
<BR>
-Ken<BR>
<BR>
<BR>
On 9/30/09 6:15 AM, "John Biddiscombe" <<a href="biddisco@cscs.ch">biddisco@cscs.ch</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Takuya <BR>
<BR>
Good work. If the kitware/Sandia guys don't respond, then I'll look at your patch in a week or two and get it in. (A lot of locator changes have been made recently, so do make sure you're using CVS pv)<BR>
<BR>
JB<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'> <BR>
Hi,<BR>
<BR>
I have had a problem of ridiculously slow D3 of PV 3.6.1/3.7-cvs under<BR>
some conditions. Most of the time the problem occurs when I have more<BR>
pvserver processes than the number of data pieces, in which case D3<BR>
takes two orders of magnitude more time than usual, despite that the<BR>
resulting repartitioned dataset looks fine.<BR>
<BR>
Attaching a performance analyzer (Apple's Shark) to the pvserver<BR>
processes revealed that, in one of the pvserver processes<BR>
vtkMergePoints::InsertUniquePoint() took up virtually all of the<BR>
processor time, as attached sharkOutput.jpg.<BR>
<BR>
It further turned out that this is because the instance of<BR>
vtkMergePoints is given indeterminate bounds by its caller<BR>
vtkMergeCells::MapPointsToIdsUsingLocator() and hence hashing based on<BR>
relative point coordinates in the bounds is not working. Here is a<BR>
proposed fix to the problem (the comment "points0->GetNumberOfPoints()<BR>
is equal to..." was taken from about 50 lines below the patched lines<BR>
in the same function. I believe it explains everything.).<BR>
<BR>
Index: vtkMergeCells.cxx<BR>
===================================================================<BR>
RCS file: /cvsroot/ParaView3/ParaView3/VTK/Graphics/vtkMergeCells.cxx,v<BR>
retrieving revision 1.9<BR>
diff -u -r1.9 vtkMergeCells.cxx<BR>
--- vtkMergeCells.cxx 23 Jan 2009 03:25:07 -0000 1.9<BR>
+++ vtkMergeCells.cxx 30 Sep 2009 06:47:09 -0000<BR>
@@ -723,7 +723,12 @@<BR>
if (npoints0 > 0)<BR>
{<BR>
double tmpbounds[6];<BR>
+ // points0->GetNumberOfPoints() is equal to the upper bound <BR>
+ // on the points in the final merged grid. We need to temporarily <BR>
+ // set it to the number of points added to the merged grid so far.<BR>
+ points0->GetData()->SetNumberOfTuples(npoints0);<BR>
grid->GetBounds(tmpbounds);<BR>
+ points0->GetData()->SetNumberOfTuples(this->TotalNumberOfPoints);<BR>
<BR>
bounds[0] = ((tmpbounds[0] < bounds[0]) ? tmpbounds[0] : bounds[0]);<BR>
bounds[2] = ((tmpbounds[2] < bounds[2]) ? tmpbounds[2] : bounds[2]);<BR>
<BR>
<BR>
Regards,<BR>
Takuya<BR>
<BR>
Takuya OSHIMA, Ph.D.<BR>
Faculty of Engineering, Niigata University<BR>
8050 Ikarashi-Ninocho, Nishi-ku, Niigata, 950-2181, JAPAN<BR>
<BR>
<BR>
<BR>
<HR ALIGN=CENTER SIZE="4" WIDTH="90%"><BR>
<BR>
<BR>
<BR>
<HR ALIGN=CENTER SIZE="4" WIDTH="90%"><BR>
_______________________________________________<BR>
Powered by www.kitware.com <<a href="http://www.kitware.com">http://www.kitware.com</a>> <BR>
<BR>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><BR>
<BR>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a><BR>
<BR>
Follow this link to subscribe/unsubscribe:<BR>
<a href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><BR>
**** Kenneth Moreland<BR>
*** Sandia National Laboratories<BR>
*********** <BR>
*** *** *** email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** *** ** phone: (505) 844-8919<BR>
*** web: <a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>