[Paraview-developers] Plugin client/server

David Cole david.cole at kitware.com
Wed Jul 27 10:45:18 EDT 2011


I think your indices may be a bit incorrect, but the spirit of the
code looks right.

Double check all of those array indices: 0,1,2 (not 0,1,3) and 1,3,5
(not 1,3,4)...


On Wed, Jul 27, 2011 at 10:35 AM, Utkarsh Ayachit
<utkarsh.ayachit at kitware.com> wrote:
> An alternative to what John suggests:
>
> double bounds[6];
> input->GetBounds(bounds);
>
> vtkMultiProcessController* controller =
> vtkMultiProcessController::GetGlobalController();
> if (controller && controller->GetNumberOfProcesses() > 1)
>  {
>  double bmin[3], bmn[3] = {bounds[0], bounds[2], bounds[4]};
>  double bmax[3], bmx[3] = {bounds[1], bounds[3], bounds[5]};
>  controller->AllReduce(bmn, bmin, 3,  vtkCommunicator::MIN_OP);
>  controller->AllReduce(bmx, bmax, 3, vtkCommunicator::MAX_OP);
>  bounds [0] = bmin[0];
>  bounds [2] = bmin[1];
>  bounds [4] = bmin[3];
>  bounds [1] = bmax[0];
>  bounds [3] = bmax[1];
>  bounds [4] = bmax[3];
>  }
>
> Utkarsh
>
> On Wed, Jul 27, 2011 at 1:11 AM, Biddiscombe, John A. <biddisco at cscs.ch> wrote:
>> I believe that the client does collect boxes from all nodes and generate the
>> information you need, but on the servers ... if my filters require the
>> global bounds, I use this.
>>
>>
>>
>> #ifdef VTK_USE_MPI
>>
>>   vtkMPICommunicator *communicator =
>> vtkMPICommunicator::SafeDownCast(this->Controller->GetCommunicator());
>>
>>   MPI_Comm mpiComm = MPI_COMM_NULL;
>>
>>   if (communicator) {
>>
>>     mpiComm = *(communicator->GetMPIComm()->GetHandle());
>>
>>   }
>>
>>
>>
>> ...
>>
>>
>>
>>   double bounds[6];
>>
>>   input->GetBounds(bounds);
>>
>>   double bmin[3], bmn[3] = {bounds[0], bounds[2], bounds[4]};
>>
>>   double bmax[3], bmx[3] = {bounds[1], bounds[3], bounds[5]};
>>
>>   MPI_Allreduce(bmn, bmin, 3, MPI_DOUBLE, MPI_MIN, mpiComm);
>>
>>   MPI_Allreduce(bmx, bmax, 3, MPI_DOUBLE, MPI_MAX, mpiComm);
>>
>>
>>
>> Cut’n’pasted with some extra code removed. Apologies if I deleted the wrong
>> lines
>>
>>
>>
>> JB
>>
>>
>>
>>
>>
>>
>>
>> From: paraview-developers-bounces at paraview.org
>> [mailto:paraview-developers-bounces at paraview.org] On Behalf Of Scott, W Alan
>> Sent: 27 July 2011 03:56
>> To: paraview-developers at paraview.org
>> Subject: [Paraview-developers] Plugin client/server
>>
>>
>>
>> I have written a filter that runs client/ multiple remote server.  This
>> filter works correctly, from what I can see.  (It just replicates a dataset,
>> in order to create a larger dataset in memory for testing and benching.)
>>
>>
>>
>> I am trying to convert this filter to a plugin.  It works local server, but
>> fails client/ remote server.  I believe that my problem is that I am trying
>> to calculate the geometric bounds of the dataset, and each of the processors
>> is returning a different bounding box – representing the bounding box of
>> this server’s data.  What I want is the bounding box of all server’s data.
>> I am using a vtkDataSet function called GetBounds.
>>
>>
>>
>> My questions are as follows:
>>
>> ·         Is there an example of how to make plugins that work for remote
>> servers, that calculate the bounds of all of the data, for all processors?
>>
>> ·         If not, is there anywhere that I should look for ldeas?
>>
>> ·         If not, is there someone I should talk to?
>>
>>
>>
>> Thanks,
>>
>>
>>
>> Alan
>>
>>
>>
>>
>>
>> --------------------------------------------------------
>>
>> W. Alan Scott
>>
>> ParaView Support Manager
>>
>>
>>
>> GAITS
>>
>> Sandia National Laboratories, MS 0822
>>
>> Org 9326 - Building 880 A1-C
>>
>> (505) 284-0932   FAX (505) 845-0833
>>
>> ---------------------------------------------------------
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Paraview-developers mailing list
>> Paraview-developers at paraview.org
>> http://public.kitware.com/mailman/listinfo/paraview-developers
>>
>>
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
>


More information about the Paraview-developers mailing list