<div dir="ltr">John,<div><br></div><div>UpdatePropertyInformation(..) will fetch the information from the "closet" instance of the vtk-object for the proxy. Since your proxy's VTK objects are created on all processes, including client, the property information indeed will be fetched from the client alone.</div>
<div><br></div><div>GatherInformation would indeed be the way to go here. <br></div><div><br></div><div>Utkarsh</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 24, 2013 at 3:35 AM, Biddiscombe, John A. <span dir="ltr"><<a href="mailto:biddisco@cscs.ch" target="_blank">biddisco@cscs.ch</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">A further question on this topic.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Using an information_only property of the representation (some params about the histogram that is generated), we try to fetch a value from it using<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black">
</span><span style="font-size:9.5pt;font-family:Consolas;color:#569cd6;background:black">bool</span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black">
hasgradrange </span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">=</span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black">
</span><span style="font-size:9.5pt;font-family:Consolas;color:#569cd6;background:black">this</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">-></span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black">GetProperty</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">(</span><span style="font-size:9.5pt;font-family:Consolas;color:#d69d85;background:black">"GradientRange"</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">);</span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black">
</span><span style="font-size:9.5pt;font-family:Consolas;color:#569cd6;background:black">if</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">(</span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black">hasgradrange</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">){</span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:#569cd6;background:black">this</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">-></span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black">UpdatePropertyInformation</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">(</span><span style="font-size:9.5pt;font-family:Consolas;color:#569cd6;background:black">this</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">-></span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black">GetProperty</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">(</span><span style="font-size:9.5pt;font-family:Consolas;color:#d69d85;background:black">"GradientRange"</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">));</span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black"> vtkSMPropertyHelper</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">(</span><span style="font-size:9.5pt;font-family:Consolas;color:#569cd6;background:black">this</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">,</span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black">
</span><span style="font-size:9.5pt;font-family:Consolas;color:#d69d85;background:black">"GradientRange"</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">).</span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black">Get</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">(</span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black">grange</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">,</span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black">
</span><span style="font-size:9.5pt;font-family:Consolas;color:#b5cea8;background:black">2</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">);</span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black"><u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black">
</span><span style="font-size:9.5pt;font-family:Consolas;color:#b4b4b4;background:black">}</span><span style="font-size:9.5pt;font-family:Consolas;color:white;background:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">but in fact this does not get values from the server. I’m curious … When we call UpdatePropertyInformation, inside the proxy code, it tests the location (of
the proxy’s object) and if CLIENT fetches values from the local proxy only.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Since representation proxies are a bit ‘special’ because they exist both on the client, and the server, this particular check always returns a client valid
code and so no server side fetch is done. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Can we use this process or should we put everything we need into the PVInformation object which works as expected and do this using the GatherInformation technique.
I presume this is that way to go, but I just wanted to double check that my understanding is correct (- perhaps I’ve made another mistake and we can use the informationonly method after all)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">thanks<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">JB<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Utkarsh Ayachit [mailto:<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>]
<br>
<b>Sent:</b> 23 October 2013 12:43</span></p><div><div class="h5"><br>
<b>To:</b> Biddiscombe, John A.<br>
<b>Cc:</b> <a href="mailto:paraview-developers@paraview.org" target="_blank">paraview-developers@paraview.org</a><br>
<b>Subject:</b> Re: [Paraview-developers] Get data from server to client (helper?)<u></u><u></u></div></div><p></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Cool. Glad to know it's working.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Utkarsh<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Tue, Oct 22, 2013 at 4:56 PM, Biddiscombe, John A. <<a href="mailto:biddisco@cscs.ch" target="_blank">biddisco@cscs.ch</a>> wrote:<u></u><u></u></p>
<p class="MsoNormal">Thanks utkarsh, the problem was at our end with a couple of bugs in the PVInformation class which caused problems. The RootOnly flag wasn't being overridden as intended and there wer also bugs in our stream insertion stuff, however, I now
have histograms for pvservers appearing in the transfer function editors on the gui. All is well<br>
<br>
Many thanks as usual<u></u><u></u></p>
<div>
<p class="MsoNormal"><br>
JB<br>
<br>
> -----Original Message-----<br>
> From: Utkarsh Ayachit [mailto:<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>]<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">> Sent: 22 October 2013 18:36<br>
> To: Biddiscombe, John A.<br>
> Cc: <a href="mailto:paraview-developers@paraview.org" target="_blank">paraview-developers@paraview.org</a><br>
> Subject: Re: [Paraview-developers] Get data from server to client (helper?)<br>
><u></u><u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">> John,<br>
><br>
> I cannot reproduce the problem. Try the attached patch. With that, I have<br>
> added code to do GatherInformation() on a representation when it's<br>
> deleted. Try this:<br>
><br>
> + Create Sphere<br>
> + Apply<br>
> + Delete Sphere<br>
><br>
> You'll see an output on the terminal when CopyFromObject is called. In<br>
> built-in mode, I see the output on the client, while in client-server mode, I<br>
> only see it on the server, as expected.<br>
><br>
> Utkarsh<br>
><br>
> On Tue, Oct 22, 2013 at 12:25 PM, Utkarsh Ayachit<br>
> <<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>> wrote:<br>
> > I don;t see anything wrong with what you're doing. Let me try it out<br>
> > to see if there's something broken/missing.<br>
> ><br>
> > Utkarsh<br>
> ><br>
> > On Tue, Oct 22, 2013 at 12:17 PM, Biddiscombe, John A. <<a href="mailto:biddisco@cscs.ch" target="_blank">biddisco@cscs.ch</a>><br>
> wrote:<br>
> >> Utkarsh<br>
> >><br>
> >>> Create a new vtkPVInformation subclass with following points to note:<br>
> >>><br>
> >>> + Override GetRootOnly() to return 1. Thus ParaView will only gather<br>
> >>> the information from the root node.<br>
> >>> + Override CopyFromObject() to downcast to right type and call which<br>
> >>> every method you want to get the data<br>
> >>> + Override CopyToStream and CopyFromStream to serialize the data<br>
> >>> collected in CopyFromObject to/from a client-server stream.<br>
> >>> + AddInformation() is used to reduce the results in parallel. Since<br>
> >>> you don't need that, I believe you can leave that empty.<br>
> >>><br>
> >>> Now, in your client code, to fetch the data you can do something as<br>
> follows:<br>
> >>><br>
> >>> vtkNew<vtkMyNewInformationClass> instance;<br>
> >>> repr->getProxy()->GatherInformation(instance.GetPointer())<br>
> >><br>
> >> When we do this, the GatherInformation call is executing on the client.<br>
> I've experimented with<br>
> >> repr->getProxy()->GatherInformation(info.GetPointer(),<br>
> >> vtkPVSession::RENDER_SERVER); but the CopyFromObject() call inside<br>
> the information is copying on the client, and so results are wrong. I had<br>
> assumed it would CopyFromObject on the root node of the server, and then<br>
> CopyToStream and on the client do a CopyDromStream.<br>
> >><br>
> >> Is there another step I need perhaps to trigger it to do this the way I<br>
> expect?<br>
> >><br>
> >> thanks<br>
> >><br>
> >> JB<u></u><u></u></p>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
</div>
</blockquote></div><br></div>