<div dir="ltr">Just a quick response off of the top of my head:<div><br></div><div>vtkMapper::Static (i.e, SetStaticOn()) prevents the mapper from propagating updates down the pipeline.</div><div><br></div><div>I have seen pipelines hacked as follows: executing them once, and then perform a local shallow copy of the resulting data into data object(s) (e.g., polydata) which is disconnected from the pipeline hence the updates are fast.</div><div><br></div><div>I suspect there are more elegant ways but maybe this will get the conversation going...</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 5, 2018 at 11:56 AM, Jonathan Borduas <span dir="ltr"><<a href="mailto:jonathan.borduas@caboma.com" target="_blank">jonathan.borduas@caboma.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="FR-CA" link="#0563C1" vlink="#954F72">
<div class="m_-3187456436790761122WordSection1">
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black"> <u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black">Hi all,
<u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black"> <u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt">VTK pipelines are great, they allow to dynamically create a flow of algorithms. However, we recently encountered a massive lag in our pipeline related to the pipeline mechanisms (as opposed to
the algorithms’ calculation time). We are using a derivative of ParaView with homemade filters.
<u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt"><u></u> <u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt">We profiled our application in such a way that the profiling session started when all of the algorithms present in the pipeline had already been executed once and were up to date. The profiler
pointed out two methods that were called a very significant amount of times while no updates were required on any of the algorithms of the pipeline. Those methods were:<u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:12.0pt">1) vtkInformation::<wbr>GetAsObjectBase(...)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:12.0pt">2) vtkDemandDrivenPipeline::<wbr>ComputePipelineMTime(...)<u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black"><u></u> <u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black">This lag doesn’t appear when only filters at the beginning of the pipeline are shown, but as we go down in the pipeline and show the outputs of filters, the lag become unbearable:<u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black"><u></u> <u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black">We think this lag is caused by the number of inputs our filters have combined with the length and complexity of the pipeline. In the following, I will explain our line of thought
and propose a way to solve our pipeline scalability problem. <u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black"><u></u> <u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><b><span lang="EN-CA" style="font-size:12.0pt;color:black">Demand Driven Pipelines for Representation:</span></b><span lang="EN-CA" style="font-size:12.0pt;color:black"><u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black">Our understanding is that a representation pipeline usually involves that the multiplicity of outputs<b> is greater than</b> the multiplicity of inputs. The pipeline fans out. This
mean that the Update() process is rather fast and scalable. <u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black"> <u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal" align="center" style="text-align:center"><span style="font-size:12.0pt;color:black"><img width="240" height="194" style="width:2.5in;height:2.0208in" id="m_-3187456436790761122x_Picture_x0020_1" src="cid:image001.jpg@01D3B474.DFE725B0"></span><span lang="EN-CA" style="font-size:12.0pt;color:black"><br>
</span><span lang="EN-CA" style="font-size:7.0pt;color:black">In the previous picture, if filter 3 needs an Update(), only filter 0,1 and 3 will have a RequestData().</span><span lang="EN-CA" style="font-size:12.0pt;color:black"><u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal" align="center" style="text-align:center"><span lang="EN-CA" style="font-size:7.0pt;color:black"> </span><span lang="EN-CA" style="font-size:12.0pt;color:black"><u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><b><span lang="EN-CA" style="font-size:12.0pt;color:black">Demand Driven Pipeline for Modeling:</span></b><span lang="EN-CA" style="font-size:12.0pt;color:black"><u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal" style="margin-bottom:12.0pt"><span lang="EN-CA" style="font-size:12.0pt;color:black">However, in our case, we use VTK as a visualisation library as well as a mesh processing tool. To process mesh, you often need multiple inputs (boolean
operations, points projections on a mesh</span><span lang="EN-CA" style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black">…</span><span lang="EN-CA" style="font-size:12.0pt;color:black">): the multiplicity of inputs is
<b>equivalent </b>to the multiplicity of outputs.<u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal" align="center" style="text-align:center"><span lang="EN-CA" style="font-size:12.0pt;color:black"><img width="278" height="336" style="width:2.8958in;height:3.5in" id="m_-3187456436790761122x_Picture_x0020_7" src="cid:image002.jpg@01D3B474.DFE725B0"></span><span style="font-size:12.0pt;color:black"><u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal" align="center" style="margin-bottom:12.0pt;text-align:center">
<span lang="EN-CA" style="font-size:7.0pt;color:black">If filter 8 needs an Update(), all filters Upstream will require to Update() except (6,3,1)</span><span lang="EN-CA" style="font-size:12.0pt;color:black"><u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black">With high input multiplicity, the Update() process, even with a distributed executive pipeline, will impact performance, creating a significant overhead.
<u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black"> <u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><b><span lang="EN-CA" style="font-size:12.0pt;color:black">Demand Driven Pipeline with Event Driven Subsets:</span></b><span lang="EN-CA" style="font-size:12.0pt;color:black"><u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black">Here we suggest an improvement over the DemandDrivenPipeline by introducing Event Driven (push) subsets:<u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black"> <u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal" align="center" style="text-align:center"><span lang="EN-CA" style="font-size:12.0pt;color:black"><img width="353" height="342" style="width:3.677in;height:3.5625in" id="m_-3187456436790761122_x0000_i1034" src="cid:image003.jpg@01D3B474.DFE725B0"><br>
</span><span lang="EN-CA" style="font-size:7.0pt;color:black">If Filter 8 needs an Update(), the signal will be passed to the subset and then to Filter0. Filter 2,4,5 and 7 are force to calculate in a Event-driven fashion.</span><span lang="EN-CA" style="font-size:12.0pt;color:black"><u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal" align="center" style="text-align:center"><span lang="EN-CA" style="font-size:12.0pt;color:black"> <u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black">The overhead of the representation pipeline Update() when you have a high input multiplicity could be reduced with the creation of subsets of a pipeline. The subsets should be handled
as Event Triggered Pipelines (Push Pipelines). <br>
<br>
A push subset could be considered like a filter that contains a small part of the pipeline and where all outputs execute a RequestData() using a Push Pipeline.<u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black"> <u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black">We are aware of the vtkThreadedStreamingPipeline that had PUSH/PULL capability, however it is now legacy. Also, we do not require the threaded/scheduler capability of this pipeline
model. An extended version of the vtkDemandDrivenPipeline with a Event Driven (pull) pipeline that would apply to a subset would be ideal.
<u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black"> <u></u><u></u></span></p>
<p class="m_-3187456436790761122xmsonormal"><span lang="EN-CA" style="font-size:12.0pt;color:black">Please share your thoughts on creating such a pipeline. Please keep in mind that this suggestion has the goal to keep the pipeline’s dynamism, we are aware that we could package
the subset into a single filter. <br>
<br>
Thank you,<br>
<br>
Jonathan Borduas<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-CA"><u></u> <u></u></span></p>
</div>
</div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://vtk.org/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">https://vtk.org/mailman/<wbr>listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>William J. Schroeder, PhD<br>Kitware, Inc. - Building the World's Technical Computing Software<br>28 Corporate Drive<br>Clifton Park, NY 12065<br><a href="mailto:will.schroeder@kitware.com" target="_blank">will.schroeder@kitware.com</a><br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>(518) 881-4902</div></div></div>
</div>