[prev in list] [next in list] [prev in thread] [next in thread] 

List:       paraview
Subject:    Re: [Paraview] RequestData gets called twice when in parallel
From:       Utkarsh Ayachit <utkarsh.ayachit () kitware ! com>
Date:       2011-08-24 19:34:24
Message-ID: CADHSJjDmFc5gr6JdGX+VprL6ME_CDxPHh0YyShqRM6Wvhk21hg () mail ! gmail ! com
[Download RAW message or body]

Paul,

I've committed a fix. It will get into git-master after the gatekeeper
review. Attached is the patch.

Utkarsh

On Wed, Aug 24, 2011 at 8:58 AM, Utkarsh Ayachit
<utkarsh.ayachit@kitware.com> wrote:
> Ah yes! John reported this too, and I had forgotten about it. Glad you
> noticed it too. I'll address it soon.
>
> Utkarsh
>
> On Wed, Aug 24, 2011 at 7:41 AM, Paul Edwards <paul.m.edwards@gmail.com> wrote:
>> Hi,
>> Filters have their RequestData called twice when using a parallel server.
>>  This happens when the filter is first added - subsequent "Apply"s only
>> called it once.
>> To reproduce:
>> First run a parallel server, attach a debugger and set a breakpoint in
>> "vtkArrayCalculator::RequestData"
>> Create a Box source
>> Use calculator to add an array, e.g. "coordsX"
>> Click Apply [ RequestData gets called twice ]
>> Update arrat , e.g. "coordsX + 0"
>> Click Apply [ RequestData only gets called once ]
>> I've added a bug report - http://www.paraview.org/Bug/view.php?id=12546
>> Regards,
>> Paul
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview
>>
>>
>

["BUG.12546.patch" (text/x-patch)]

commit cb9bc043970d96dc5f36ca9b7e06c74d0b78eda6
Author: Utkarsh Ayachit <utkarsh.ayachit@kitware.com>
Date:   Wed Aug 24 15:31:22 2011 -0400

    Fixed BUG #12546. RequestData was called twice in parallel.
    
    The issue was introduced by fix for BUG #11811. We were now requesting
    ghost-cells in representations to use the ghost-cell information when available
    during rendering. However that meant that all the request changed since previous
    update on the pipeline, since the GUI would call UpdatePipeline() when creating
    the representation but without the extra ghost cells.
    
    Fixed this issue by making the GUI also ask for ghost-cells in a similar fashion
    to vtkGeometryRepresentation. This was done by updating
    vtkSISourceProxy::UpdatePipeline to request ghost cells using the logic in
    vtkGeometryRepresentation.
    
    vtkGeometryRepresentation was checking for data-type when deciding whether to
    ask for ghost cells. That meant that vtkSISourceProxy couldn't use it since the
    algorithm had not produced any data yet. Anyways, the datatype check was
    unnecessary since we were using the presence of WHOLE_EXTENT() key to exclude
    any structure data pipelines. So removed that type check. I verified that it
    doesn't lead to any wrong ghost cell requests when contouring, for example.

diff --git a/ParaViewCore/ClientServerCore/vtkGeometryRepresentation.cxx \
b/ParaViewCore/ClientServerCore/vtkGeometryRepresentation.cxx index f3c3d10..f4bdb8c \
                100644
--- a/ParaViewCore/ClientServerCore/vtkGeometryRepresentation.cxx
+++ b/ParaViewCore/ClientServerCore/vtkGeometryRepresentation.cxx
@@ -294,6 +294,28 @@ int vtkGeometryRepresentation::ProcessViewRequest(
 }
 
 //----------------------------------------------------------------------------
+bool vtkGeometryRepresentation::DoRequestGhostCells(vtkInformation* info)
+{
+  vtkMultiProcessController* controller =
+    vtkMultiProcessController::GetGlobalController();
+  if (controller == NULL || controller->GetNumberOfProcesses() <= 1)
+    {
+    return false;
+    }
+
+  // ensure that there's no WholeExtent to ensure
+  // that this UG was never born out of a structured dataset.
+  bool has_whole_extent = (info->Has(
+      vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()) != 0);
+  if (!has_whole_extent)
+    {
+    return true;
+    }
+
+  return false;
+}
+
+//----------------------------------------------------------------------------
 int vtkGeometryRepresentation::RequestUpdateExtent(vtkInformation* request,
   vtkInformationVector** inputVector,
   vtkInformationVector* outputVector)
@@ -302,9 +324,7 @@ int \
vtkGeometryRepresentation::RequestUpdateExtent(vtkInformation* request,  
   // ensure that the ghost-level information is setup correctly to avoid
   // internal faces for unstructured grids.
-  vtkMultiProcessController* controller =
-    vtkMultiProcessController::GetGlobalController();
-  for (int cc=0; cc < this->GetNumberOfInputPorts() && controller != NULL; cc++)
+  for (int cc=0; cc < this->GetNumberOfInputPorts(); cc++)
     {
     for (int kk=0; kk < inputVector[cc]->GetNumberOfInformationObjects(); kk++)
       {
@@ -313,21 +333,9 @@ int \
vtkGeometryRepresentation::RequestUpdateExtent(vtkInformation* request,  \
                vtkStreamingDemandDrivenPipeline* sddp =
         vtkStreamingDemandDrivenPipeline::SafeDownCast(this->GetExecutive());
       int ghostLevels = sddp->GetUpdateGhostLevel(inInfo);
-      if (controller->GetNumberOfProcesses() > 1)
+      if (vtkGeometryRepresentation::DoRequestGhostCells(inInfo))
         {
-        vtkUnstructuredGrid* ug_input = vtkUnstructuredGrid::GetData(inInfo);
-        vtkCompositeDataSet* cd_input = vtkCompositeDataSet::GetData(inInfo);
-        if (ug_input || cd_input)
-          {
-          // ensure that there's no WholeExtent to ensure
-          // that this UG was never born out of a structured dataset.
-          bool has_whole_extent = (inInfo->Has(
-              vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()) != 0);
-          if (!has_whole_extent)
-            {
-            ghostLevels++;
-            }
-          }
+        ghostLevels++;
         }
       sddp->SetUpdateGhostLevel(inInfo, ghostLevels);
       }
diff --git a/ParaViewCore/ClientServerCore/vtkGeometryRepresentation.h \
b/ParaViewCore/ClientServerCore/vtkGeometryRepresentation.h index d6188c6..b6a0388 \
                100644
--- a/ParaViewCore/ClientServerCore/vtkGeometryRepresentation.h
+++ b/ParaViewCore/ClientServerCore/vtkGeometryRepresentation.h
@@ -124,6 +124,11 @@ public:
   // Returns the data object that is rendered from the given input port.
   virtual vtkDataObject* GetRenderedDataObject(int port);
 
+  // Description:
+  // Returns true if this class would like to get ghost-cells if available for
+  // the connection whose information object is passed as the argument.
+  static bool DoRequestGhostCells(vtkInformation* information); 
+
   //***************************************************************************
   // Forwarded to vtkPVGeometryFilter
   void SetUseOutline(int);
diff --git a/ParaViewCore/ServerImplementation/vtkSISourceProxy.cxx \
b/ParaViewCore/ServerImplementation/vtkSISourceProxy.cxx index 80d47ed..b207a2b \
                100644
--- a/ParaViewCore/ServerImplementation/vtkSISourceProxy.cxx
+++ b/ParaViewCore/ServerImplementation/vtkSISourceProxy.cxx
@@ -19,6 +19,7 @@
 #include "vtkClientServerInterpreter.h"
 #include "vtkCommand.h"
 #include "vtkCompositeDataPipeline.h"
+#include "vtkGeometryRepresentation.h"
 #include "vtkInformation.h"
 #include "vtkInstantiator.h"
 #include "vtkMultiProcessController.h"
@@ -354,9 +355,17 @@ void vtkSISourceProxy::UpdatePipeline(int port, double time, \
bool doTime)  vtkStreamingDemandDrivenPipeline* sddp =
     vtkStreamingDemandDrivenPipeline::SafeDownCast(
       algo->GetExecutive());
-
   int real_port = output_port->GetIndex();
-  sddp->SetUpdateExtent(real_port, processid, numprocs, /*ghost level*/0);
+
+  // Refer to BUG #11811 and BUG #12546. vtkGeometryRepresentation needs
+  // ghost-cells if available (11811), but not asking for ghost-cells earlier than \
the +  // representation results in multiple executes (12546). Hence, we request
+  // ghost-cells in UpdatePipeline().
+  bool req_ghost_cells = vtkGeometryRepresentation::DoRequestGhostCells(
+    sddp->GetOutputInformation(real_port));
+
+  sddp->SetUpdateExtent(real_port, processid, numprocs, /*ghost level*/
+    req_ghost_cells?1 : 0);
   if (doTime)
     {
     sddp->SetUpdateTimeStep(real_port, time);



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic