[Paraview-developers] Get data from server to client (helper?)

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Oct 24 05:34:30 EDT 2013


John,

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.

GatherInformation would indeed be the way to go here.

Utkarsh


On Thu, Oct 24, 2013 at 3:35 AM, Biddiscombe, John A. <biddisco at cscs.ch>wrote:

>  A further question on this topic.****
>
> ** **
>
> 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****
>
> ** **
>
>   bool hasgradrange = this->GetProperty("GradientRange");****
>
>   if(hasgradrange){****
>
>     this->UpdatePropertyInformation(this->GetProperty("GradientRange"));**
> **
>
>     vtkSMPropertyHelper(this, "GradientRange").Get(grange, 2);****
>
>   }****
>
> ** **
>
> 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.****
>
> 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. ****
>
> ** **
>
> 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)*
> ***
>
> ** **
>
> thanks****
>
> ** **
>
> JB****
>
> ** **
>
> *From:* Utkarsh Ayachit [mailto:utkarsh.ayachit at kitware.com]
> *Sent:* 23 October 2013 12:43
>
> *To:* Biddiscombe, John A.
> *Cc:* paraview-developers at paraview.org
> *Subject:* Re: [Paraview-developers] Get data from server to client
> (helper?)****
>
>  ** **
>
> Cool. Glad to know it's working.****
>
> ** **
>
> Utkarsh****
>
> ** **
>
> On Tue, Oct 22, 2013 at 4:56 PM, Biddiscombe, John A. <biddisco at cscs.ch>
> wrote:****
>
> 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
>
> Many thanks as usual****
>
>
> JB
>
> > -----Original Message-----
> > From: Utkarsh Ayachit [mailto:utkarsh.ayachit at kitware.com]****
>
> > Sent: 22 October 2013 18:36
> > To: Biddiscombe, John A.
> > Cc: paraview-developers at paraview.org
> > Subject: Re: [Paraview-developers] Get data from server to client
> (helper?)
> >****
>
> > John,
> >
> > I cannot reproduce the problem. Try the attached patch. With that, I have
> > added code to do GatherInformation() on a representation when it's
> > deleted. Try this:
> >
> > + Create Sphere
> > + Apply
> > + Delete Sphere
> >
> > You'll see an output on the terminal when CopyFromObject is called. In
> > built-in mode, I see the output on the client, while in client-server
> mode, I
> > only see it on the server, as expected.
> >
> > Utkarsh
> >
> > On Tue, Oct 22, 2013 at 12:25 PM, Utkarsh Ayachit
> > <utkarsh.ayachit at kitware.com> wrote:
> > > I don;t see anything wrong with what you're doing. Let me try it out
> > > to see if there's something broken/missing.
> > >
> > > Utkarsh
> > >
> > > On Tue, Oct 22, 2013 at 12:17 PM, Biddiscombe, John A. <
> biddisco at cscs.ch>
> > wrote:
> > >> Utkarsh
> > >>
> > >>> Create a new vtkPVInformation subclass with following points to note:
> > >>>
> > >>> + Override GetRootOnly() to return 1. Thus ParaView will only gather
> > >>> the information from the root node.
> > >>> + Override CopyFromObject() to downcast to right type and call which
> > >>> every method you want to get the data
> > >>> + Override CopyToStream and CopyFromStream to serialize the data
> > >>> collected in CopyFromObject to/from a client-server stream.
> > >>> + AddInformation() is used to reduce the results in parallel. Since
> > >>> you don't need that, I believe you can leave that empty.
> > >>>
> > >>> Now, in your client code, to fetch the data you can do something as
> > follows:
> > >>>
> > >>> vtkNew<vtkMyNewInformationClass> instance;
> > >>> repr->getProxy()->GatherInformation(instance.GetPointer())
> > >>
> > >> When we do this, the GatherInformation call is executing on the
> client.
> > I've experimented with
> > >>   repr->getProxy()->GatherInformation(info.GetPointer(),
> > >> vtkPVSession::RENDER_SERVER); but the CopyFromObject() call inside
> > the information is copying on the client, and so results are wrong. I had
> > assumed it would CopyFromObject on the root node of the server, and then
> > CopyToStream and on the client do a CopyDromStream.
> > >>
> > >> Is there another step I need perhaps to trigger it to do this the way
> I
> > expect?
> > >>
> > >> thanks
> > >>
> > >> JB****
>
> ** **
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20131024/922467f7/attachment-0001.htm>


More information about the Paraview-developers mailing list