Commit 50b777ce authored by Allison Vacanti's avatar Allison Vacanti
Browse files

Add a minimum ghost level option to D3.

parent 5b514bdd
......@@ -200,6 +200,35 @@ void MyProcess::Execute()
prm->InitializeOffScreen(); // Mesa GL only
// Test the minimum ghost cell settings:
bool ghostCellSuccess = true;
{
dd->UseMinimalMemoryOn();
dd->SetBoundaryModeToAssignToOneRegion();
dd->SetMinimumGhostLevel(0);
dd->Update();
int ncells = static_cast<vtkUnstructuredGrid*>(dd->GetOutput())->GetNumberOfCells();
if (me == 0 && ncells != 79)
{
std::cerr << "Invalid number of cells for ghost level 0: " << ncells << "\n";
ghostCellSuccess = false;
}
dd->SetMinimumGhostLevel(2);
dd->Update();
ncells = static_cast<vtkUnstructuredGrid*>(dd->GetOutput())->GetNumberOfCells();
if (me == 0 && ncells != 160)
{
std::cerr << "Invalid number of cells for ghost level 2: " << ncells << "\n";
ghostCellSuccess = false;
}
dd->SetMinimumGhostLevel(0);
dd->UseMinimalMemoryOff();
dd->SetBoundaryModeToSplitBoundaryCells(); // clipping
}
// We must update the whole pipeline here, otherwise node 0
// goes into GetActiveCamera which updates the pipeline, putting
// it into vtkDistributedDataFilter::Execute() which then hangs.
......@@ -236,6 +265,11 @@ void MyProcess::Execute()
this->ReturnValue =
vtkRegressionTester::Test(this->Argc,this->Argv,renWin, 10);
if (this->ReturnValue == vtkTesting::PASSED && !ghostCellSuccess)
{
this->ReturnValue = vtkTesting::FAILED;
}
if (ncells != 152)
{
this->ReturnValue = vtkTesting::FAILED;
......
......@@ -170,6 +170,7 @@ vtkDistributedDataFilter::vtkDistributedDataFilter()
this->NumConvexSubRegions = 0;
this->ConvexSubRegionBounds = nullptr;
this->MinimumGhostLevel = 0;
this->GhostLevel = 0;
this->RetainKdtree = 1;
......@@ -497,6 +498,7 @@ int vtkDistributedDataFilter::RequestData(
this->GhostLevel = outInfo->Get(
vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());
this->GhostLevel = std::max(this->GhostLevel, this->MinimumGhostLevel);
// get the input and output
vtkDataSet *inputDS = vtkDataSet::GetData(inputVector[0], 0);
......
......@@ -220,6 +220,12 @@ public:
vtkGetMacro(UseMinimalMemory, int);
vtkSetMacro(UseMinimalMemory, int);
/**
* The minimum number of ghost levels to add to each processor's output. If
* the pipeline also requests ghost levels, the larger value will be used.
*/
vtkGetMacro(MinimumGhostLevel, int)
vtkSetMacro(MinimumGhostLevel, int)
/**
* Turn on collection of timing data
......@@ -610,6 +616,10 @@ private:
int NumConvexSubRegions;
double *ConvexSubRegionBounds;
// User-adjustable minimum number of ghost levels.
int MinimumGhostLevel;
// Actual number of ghost levels used during execution.
int GhostLevel;
int RetainKdtree;
......
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