Commit ae436258 authored by Yohann Bearzi's avatar Yohann Bearzi Committed by Kitware Robot
Browse files

Merge topic 'roll-back-duplicate-output-stats'

ba3ff977

 Rollback removing of duplicate outputs in Statistics filters
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Cory Quammen's avatarCory Quammen <cory.quammen@kitware.com>
Merge-request: !9177
parents dc143f12 ba3ff977
......@@ -142,29 +142,13 @@ int TestPCorrelativeStatistics(int argc, char* argv[])
auto outRefModel = vtkMultiBlockDataSet::SafeDownCast(refStats->GetOutputDataObject(1));
auto outRefTests = vtkTable::SafeDownCast(refStats->GetOutputDataObject(2));
// Testing measured statistics. Rank other than 0 should not have any data.
if (myrank == 0)
{
auto outPrimaryTable = vtkTable::SafeDownCast(outModel->GetBlock(0));
auto outRefPrimaryTable = vtkTable::SafeDownCast(outRefModel->GetBlock(0));
auto outPrimaryTable = vtkTable::SafeDownCast(outModel->GetBlock(0));
auto outRefPrimaryTable = vtkTable::SafeDownCast(outRefModel->GetBlock(0));
if (!TablesAreSame(outPrimaryTable, outRefPrimaryTable))
{
vtkLog(ERROR, "Measured statistics mismatch between single-process and multi-process.");
retVal = EXIT_FAILURE;
}
}
else
if (!TablesAreSame(outPrimaryTable, outRefPrimaryTable))
{
std::vector<vtkTable*> outputs = vtkCompositeDataSet::GetDataSets<vtkTable>(outModel);
for (vtkTable* output : outputs)
{
if (output->GetNumberOfColumns())
{
vtkLog(ERROR, "Output other than rank 0 has a non-empty output model.");
retVal = EXIT_FAILURE;
}
}
vtkLog(ERROR, "Measured statistics mismatch between single-process and multi-process.");
retVal = EXIT_FAILURE;
}
// Testing outData.
......
......@@ -148,29 +148,13 @@ int TestPDescriptiveStatistics(int argc, char* argv[])
vtkLog(INFO, "Testing Model");
// Testing measured statistics. Rank other than 0 should not have any data.
if (myrank == 0)
{
auto outPrimaryTable = vtkTable::SafeDownCast(outModel->GetBlock(0));
auto outRefPrimaryTable = vtkTable::SafeDownCast(outRefModel->GetBlock(0));
auto outPrimaryTable = vtkTable::SafeDownCast(outModel->GetBlock(0));
auto outRefPrimaryTable = vtkTable::SafeDownCast(outRefModel->GetBlock(0));
if (!TablesAreSame(outPrimaryTable, outRefPrimaryTable))
{
vtkLog(ERROR, "Measured statistics mismatch between single-process and multi-process.");
retVal = EXIT_FAILURE;
}
}
else
if (!TablesAreSame(outPrimaryTable, outRefPrimaryTable))
{
std::vector<vtkTable*> outputs = vtkCompositeDataSet::GetDataSets<vtkTable>(outModel);
for (vtkTable* output : outputs)
{
if (output->GetNumberOfColumns())
{
vtkLog(ERROR, "Output other than rank 0 has a non-empty output model.");
retVal = EXIT_FAILURE;
}
}
vtkLog(ERROR, "Measured statistics mismatch between single-process and multi-process.");
retVal = EXIT_FAILURE;
}
vtkLog(INFO, "Testing Assess");
......
......@@ -179,22 +179,3 @@ void vtkPCorrelativeStatistics::Test(
this->Superclass::Test(inData, inMeta, outMeta);
}
//------------------------------------------------------------------------------
int vtkPCorrelativeStatistics::RequestData(
vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
{
int retVal = this->Superclass::RequestData(request, inputVector, outputVector);
if (this->Controller && this->Controller->GetLocalProcessId() != 0)
{
vtkMultiBlockDataSet* outModel = vtkMultiBlockDataSet::GetData(outputVector, OUTPUT_MODEL);
std::vector<vtkDataObject*> outputs = vtkCompositeDataSet::GetDataSets<vtkDataObject>(outModel);
for (vtkDataObject* output : outputs)
{
output->Initialize();
}
}
return retVal;
}
......@@ -70,8 +70,6 @@ protected:
vtkPCorrelativeStatistics();
~vtkPCorrelativeStatistics() override;
int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
vtkMultiProcessController* Controller;
private:
......
......@@ -187,22 +187,3 @@ void vtkPDescriptiveStatistics::Learn(
}
delete[] n_g;
}
//------------------------------------------------------------------------------
int vtkPDescriptiveStatistics::RequestData(
vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
{
int retVal = this->Superclass::RequestData(request, inputVector, outputVector);
if (this->Controller && this->Controller->GetLocalProcessId() != 0)
{
vtkMultiBlockDataSet* outModel = vtkMultiBlockDataSet::GetData(outputVector, OUTPUT_MODEL);
std::vector<vtkDataObject*> outputs = vtkCompositeDataSet::GetDataSets<vtkDataObject>(outModel);
for (vtkDataObject* output : outputs)
{
output->Initialize();
}
}
return retVal;
}
......@@ -73,8 +73,6 @@ protected:
vtkMultiProcessController* Controller;
int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
private:
vtkPDescriptiveStatistics(const vtkPDescriptiveStatistics&) = delete;
void operator=(const vtkPDescriptiveStatistics&) = delete;
......
Supports Markdown
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