<html><head></head><body><div dir="auto">Thanks - that gives me already a trace to follow: "mtime != pipeline time"!<br><br></div>
<div dir="auto">And thanks also for the offer to have a look into the code! However I guess that if I really have some pointer problem, like writing unallocated memory or the like, this is not in one single file but some "fatal cooperation" between program parts...<br><br></div>
<div dir="auto">I will have to step by step comment out functionality, see where it goes away and so narrow the potentially "guilty code"...<br><br></div>
<div dir="auto">Regards, Cornelis<br><br></div>
<div dir="auto"><!-- tmjah_g_1299s -->Gesendet mit <!-- tmjah_g_1299e --><a href="http://www.bluemail.me/r?b=11327"><!-- tmjah_g_1299s -->BlueMail<!-- tmjah_g_1299e --></a><!-- tmjah_g_1299s --> <!-- tmjah_g_1299e --></div>
<div class="gmail_quote" >Am 20. März 2018, um 21:43, Utkarsh Ayachit <<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>> schrieb:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Cornelis,</span>
<br>
<div>
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span>
</div>
<div>
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">I don't see anything fundamentally wrong about your approach (except that you're assuming the input to this will never change dramatically enough to invalidate all the caches, but let's assume that's the case).</span>
</div>
<div>
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span>
</div>
<div>
<span style="font-size:12.8px">If you're getting segfaults due to `GetMTime`, it's actually something else that's doing on, some bad ptr, access, etc. MTime is different from the pipeline time. MTime is just a timestamp on VTK objects to indicate when they were last modified, for example. If you share your filter.cxx, I can see if I can spot the issue.</span>
</div>
<div>
<span style="font-size:12.8px"><br></span>
</div>
<div>
<span style="font-size:12.8px">Utkarsh</span>
</div>
</div>
<div class="gmail_extra">
<br>
<div class="gmail_quote">
On Tue, Mar 20, 2018 at 1:19 PM, Cornelis Bockemühl
<span dir="ltr"><<a href="mailto:cornelis.bockemuehl@gmail.com" target="_blank">cornelis.bockemuehl@gmail.com</a>></span> wrote:
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div>
My short question is: I am having some problems to understand time handling in VTK, so I would like to find some documentations that can enlighten me! So far my Google research has only shown me that a) there have been different approaches in the past (which I do not need to understand) and b) there are many more options available than I will ever need to use...
</div>
<div>
<br>
</div>
<div>
The specific problem that I am dealing with is in a project. In a filter that is supposed to run inside ParaView I am programmatically generating a time series of unsigned grids and tables, i.e. the filter has several several output ports that all have to change per time step. Empirically I found out that I have to put this code into RequestInformation:
</div>
<div>
<br>
</div>
<div>
<pre><span style="color:#c0c0c0"> </span><span style="color:#008000">//</span><span style="color:#c0c0c0"> </span><span style="color:#008000">tell</span><span style="color:#c0c0c0"> </span><span style="color:#008000">the</span><span style="color:#c0c0c0"> </span><span style="color:#008000">caller</span><span style="color:#c0c0c0"> </span><span style="color:#008000">that</span><span style="color:#c0c0c0"> </span><span style="color:#008000">we</span><span style="color:#c0c0c0"> </span><span style="color:#008000">can</span><span style="color:#c0c0c0"> </span><span style="color:#008000">provide</span><span style="color:#c0c0c0"> </span><span style="color:#008000">time</span><span style="color:#c0c0c0"> </span><span style="color:#008000">varying</span><span style="color:#c0c0c0"> </span><span style="color:#008000">data</span><span style="color:#c0c0c0"> </span><span style="color:#008000">and</span><span style="color:#c0c0c0"> </span><span style="color:#008000">specify</span><span style="color:#c0c0c0"> </span><span style="color:#008000">the</span><span style="color:#c0c0c0"> </span><span style="color:#008000">range</span></pre>
<pre><span style="color:#c0c0c0"> </span><span style="color:#808000">double</span><span style="color:#c0c0c0"> </span><span style="color:#092e64">tRange</span>[]<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span>{<span style="color:#000080">0.</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">1.</span>};</pre>
<pre><br></pre>
<pre><span style="color:#c0c0c0"> </span><span style="color:#008000">//</span><span style="color:#c0c0c0"> </span><span style="color:#008000">generate</span><span style="color:#c0c0c0"> </span><span style="color:#008000">a</span><span style="color:#c0c0c0"> </span><span style="color:#008000">vector</span><span style="color:#c0c0c0"> </span><span style="color:#008000">with</span><span style="color:#c0c0c0"> </span><span style="color:#008000">the</span><span style="color:#c0c0c0"> </span><span style="color:#008000">steps</span><span style="color:#c0c0c0"> </span><span style="color:#008000">-</span><span style="color:#c0c0c0"> </span><span style="color:#008000">from</span><span style="color:#c0c0c0"> </span><span style="color:#008000">0</span><span style="color:#c0c0c0"> </span><span style="color:#008000">to</span><span style="color:#c0c0c0"> </span><span style="color:#008000">NumSteps</span></pre>
<pre><span style="color:#c0c0c0"> </span><span style="color:#800000">Steps</span>.<span style="color:#00677c">resize</span>(<span style="color:#800000">NumPeriods</span><span style="color:#c0c0c0"> </span>+<span style="color:#c0c0c0"> </span><span style="color:#000080">1</span>);</pre>
<pre><span style="color:#c0c0c0"> </span><span style="color:#808000">for</span>(<span style="color:#808000">int</span><span style="color:#c0c0c0"> </span><span style="color:#092e64">s</span><span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>;<span style="color:#c0c0c0"> </span><span style="color:#092e64">s</span><span style="color:#c0c0c0"> </span><=<span style="color:#c0c0c0"> </span><span style="color:#800000">NumPeriods</span>;<span style="color:#c0c0c0"> </span>++<span style="color:#092e64">s</span>)</pre>
<pre><span style="color:#c0c0c0"> </span><span style="color:#800000">Steps</span>[<span style="color:#092e64">s</span>]<span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span>(<span style="color:#808000">double</span>)<span style="color:#092e64">s</span><span style="color:#c0c0c0"> </span>/<span style="color:#c0c0c0"> </span>(<span style="color:#808000">double</span>)<span style="color:#800000">NumPeriods</span>;</pre>
<pre><br></pre>
<pre><span style="color:#c0c0c0"> </span><span style="color:#808000">for</span>(<span style="color:#808000">int</span><span style="color:#c0c0c0"> </span><span style="color:#092e64">n</span><span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#000080">0</span>;<span style="color:#c0c0c0"> </span><span style="color:#092e64">n</span><span style="color:#c0c0c0"> </span><<span style="color:#c0c0c0"> </span><span style="color:#00677c">GetNumberOfOutputPorts</span>();<span style="color:#c0c0c0"> </span>++<span style="color:#092e64">n</span>)</pre>
<pre><span style="color:#c0c0c0"> </span>{</pre>
<pre><span style="color:#c0c0c0"> </span><span style="color:#800080">vtkInformation</span>*<span style="color:#c0c0c0"> </span><span style="color:#092e64">info</span><span style="color:#c0c0c0"> </span>=<span style="color:#c0c0c0"> </span><span style="color:#092e64">outputVector</span>-><span style="color:#00677c">GetInformationOb<wbr>ject</span>(<span style="color:#092e64">n</span>);</pre>
<pre><span style="color:#c0c0c0"> </span><span style="color:#092e64">info</span>-><span style="color:#00677c">Set</span>(<span style="color:#800080">vtkStreamingDemandDr<wbr>ivenPipeline</span>::<span style="color:#00677c">TIME_RANGE</span>(),<span style="color:#c0c0c0"> </span><span style="color:#092e64">tRange</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">2</span>);</pre>
<pre><span style="color:#c0c0c0"> </span><span style="color:#092e64">info</span>-><span style="color:#00677c">Set</span>(<span style="color:#800080">vtkStreamingDemandDr<wbr>ivenPipeline</span>::<span style="color:#00677c">TIME_STEPS</span>(),<span style="color:#c0c0c0"> </span><span style="color:#800000">Steps</span>.<span style="color:#00677c">data</span>(),<span style="color:#c0c0c0"> </span><span style="color:#800000">Steps</span>.<span style="color:#00677c">size</span>());</pre>
<pre><span style="color:#c0c0c0"> </span><span style="color:#092e64">info</span>-><span style="color:#00677c">Set</span>(<span style="color:#00677c">CAN_HANDLE_PIECE_<wbr>REQUEST</span>(),<span style="color:#c0c0c0"> </span><span style="color:#000080">1</span>);</pre>
<pre><span style="color:#c0c0c0"> </span>}</pre>
<pre><br></pre>
</div>
<div>
Some of the calculations are a bit tedious, so I am caching many data in the filter object, but not more than so far required. This means that in RequestData a decision has to be taken if more data need to be calculated first, or else directly copy from the cached data, like for example this:
</div>
<div>
<br>
</div>
<div>
- jump to step 5 of 20 directly -> calculate steps 1 - 2 - 3 - 4 - 5 internally, then copy data from step 5 to the output ports
</div>
<div>
<br>
</div>
<div>
- jump back to step 3 -> simply copy the data from step 3 to the output ports
</div>
<div>
<br>
</div>
<div>
- jump to step 7 -> calculate steps 6 - 7, then copy etc.
</div>
<div>
<br>
</div>
<div>
During the calculations I am using other filters for some data processing, not attached to the pipeline, for some data transformations. For some time this worked now "somehow", but now I am suddenly getting crashes in one of these "detached filters" - when some "trivial producer" wants to ask for MTime - which is completely irrelevant in that context...
</div>
<div>
<br>
</div>
<div>
In other words: I am now a bit confused - and at the same time I am afraid that I cannot easily strip down my problem to a size that I can easily share!
</div>
<div>
<br>
</div>
<div>
Specifically I am not sure which way to try further:
</div>
<div>
<br>
</div>
<div>
- somehow "tell the filters" that they should not care about time?
</div>
<div>
<br>
</div>
<div>
- reconsider my caching because maybe it interferes with some similar functionality that is already built into ParaView?
</div>
<div>
<br>
</div>
<div>
- somehow "tell" the output unstructured grids and tables which is their current MTime? But so far I thought I had understood that this is managed by ParaView, not by the data objects...
</div>
<div>
<br>
</div>
<div>
...but then some of the data objects have a GetMTime function, but no way to explicitly set this fabulous MTime: where does it come from?
</div>
<div>
<br>
</div>
<div>
Actually such a call is the location where the program crashes!
</div>
<div>
<br>
</div>
<div>
Regards,
</div>
<div>
Cornelis Bockemühl
</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=Paraview-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>Paraview-developers</a>
<br>
<br> Follow this link to subscribe/unsubscribe:
<br>
<a href="https://public.kitware.com/mailman/listinfo/paraview-developers" rel="noreferrer" target="_blank">https://public.kitware.com/<wbr>mailman/listinfo/paraview-<wbr>developers</a>
<br>
<br>
</blockquote>
</div>
<br>
</div></blockquote></div></body></html>