Commit 44ba0bc3 authored by Mark Olesen's avatar Mark Olesen

COMP: avoid ref to synchronization for non-MPI VTK build (fixes #1349)

parent 19f1179f
Pipeline #138 failed with stages
...@@ -42,15 +42,14 @@ License ...@@ -42,15 +42,14 @@ License
#include "vtkSmartPointer.h" #include "vtkSmartPointer.h"
#include "vtkLight.h" #include "vtkLight.h"
#include "vtkDummyController.h"
#ifdef FOAM_USING_VTK_MPI #ifdef FOAM_USING_VTK_MPI
# include "vtkMPICommunicator.h" # include "vtkMPICommunicator.h"
# include "vtkMPIController.h" # include "vtkMPIController.h"
# include "vtkCompositedSynchronizedRenderers.h"
# include "vtkSynchronizedRenderWindows.h"
#endif #endif
#include "vtkDummyController.h"
#include "vtkSynchronizedRenderWindows.h"
#include "vtkCompositedSynchronizedRenderers.h"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...@@ -137,27 +136,21 @@ void Foam::functionObjects::runTimePostProcessing::render ...@@ -137,27 +136,21 @@ void Foam::functionObjects::runTimePostProcessing::render
Log << name() << " render" << endl; Log << name() << " render" << endl;
} }
// Normal rendering elements
vtkSmartPointer<vtkRenderer> renderer;
vtkSmartPointer<vtkRenderWindow> renderWindow;
// Multi-process synchronization
vtkSmartPointer<vtkSynchronizedRenderWindows> syncWindows;
vtkSmartPointer<vtkCompositedSynchronizedRenderers> syncRenderers;
// Disable any floating point trapping // Disable any floating point trapping
// (some low-level rendering functionality does not like it) // (some low-level rendering functionality does not like it)
sigFpe::ignore sigFpeHandling; //<- disable in local scope sigFpe::ignore sigFpeHandling; //<- disable in local scope
// Normal rendering elements
vtkSmartPointer<vtkRenderer> renderer;
vtkSmartPointer<vtkRenderWindow> renderWindow;
// Initialise render window // Initialise render window
if (controller || Pstream::master()) if (controller || Pstream::master())
{ {
renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
renderer = vtkSmartPointer<vtkRenderer>::New(); renderer = vtkSmartPointer<vtkRenderer>::New();
renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
renderWindow->OffScreenRenderingOn(); renderWindow->OffScreenRenderingOn();
renderWindow->SetSize(output_.width_, output_.height_); renderWindow->SetSize(output_.width_, output_.height_);
...@@ -174,15 +167,22 @@ void Foam::functionObjects::runTimePostProcessing::render ...@@ -174,15 +167,22 @@ void Foam::functionObjects::runTimePostProcessing::render
renderWindow->AddRenderer(renderer); renderWindow->AddRenderer(renderer);
} }
// Synchronization
// ---------------------
#ifdef FOAM_USING_VTK_MPI
// Multi-process synchronization
vtkSmartPointer<vtkCompositedSynchronizedRenderers> syncRenderers;
vtkSmartPointer<vtkSynchronizedRenderWindows> syncWindows;
if (controller) if (controller)
{ {
syncWindows =
vtkSmartPointer<vtkSynchronizedRenderWindows>::New();
syncRenderers = syncRenderers =
vtkSmartPointer<vtkCompositedSynchronizedRenderers>::New(); vtkSmartPointer<vtkCompositedSynchronizedRenderers>::New();
syncWindows =
vtkSmartPointer<vtkSynchronizedRenderWindows>::New();
syncWindows->SetRenderWindow(renderWindow); syncWindows->SetRenderWindow(renderWindow);
syncWindows->SetParallelController(controller); syncWindows->SetParallelController(controller);
syncWindows->SetIdentifier(1); syncWindows->SetIdentifier(1);
...@@ -193,7 +193,7 @@ void Foam::functionObjects::runTimePostProcessing::render ...@@ -193,7 +193,7 @@ void Foam::functionObjects::runTimePostProcessing::render
syncRenderers->SetRenderer(renderer); syncRenderers->SetRenderer(renderer);
syncRenderers->SetParallelController(controller); syncRenderers->SetParallelController(controller);
} }
#endif
// --------------------- // ---------------------
scene_.initialise(renderer, output_.name_); scene_.initialise(renderer, output_.name_);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment