Enable setting presimplification for distributed CT app/filter

This commit is contained in:
Oliver Ruebel 2023-08-07 03:26:59 -07:00 committed by Gunther H. Weber
parent bd83490425
commit 22d394d846
3 changed files with 29 additions and 0 deletions

@ -220,6 +220,12 @@ int main(int argc, char* argv[])
}
}
vtkm::Id presimplifyThreshold = 0; // Do not presimplify the hierachical contour tree
if (parser.hasOption("--presimplifyThreshold"))
{
presimplifyThreshold = std::stoi(parser.getOption("--presimplifyThreshold"));
}
bool useBoundaryExtremaOnly = true;
if (parser.hasOption("--useFullBoundary"))
{
@ -368,6 +374,10 @@ int main(int argc, char* argv[])
std::cout
<< "--eps=<float> Floating point offset awary from the critical point. (default=0.00001)"
<< std::endl;
std::cout << "--presimplifyThreshold Integer volume threshold for presimplifying the tree"
<< std::endl;
std::cout << " Default value is 0, indicating no presimplification"
<< std::endl;
std::cout << "--preSplitFiles Input data is already pre-split into blocks." << std::endl;
std::cout << "--saveDot Save DOT files of the distributed contour tree " << std::endl
<< " computation (Default=False). " << std::endl;
@ -411,6 +421,7 @@ int main(int argc, char* argv[])
<< " augmentHierarchicalTree=" << augmentHierarchicalTree << std::endl
<< " computeVolumetricBranchDecomposition="
<< computeHierarchicalVolumetricBranchDecomposition << std::endl
<< " presimplifyThreshold=" << presimplifyThreshold << std::endl
<< " saveOutputData=" << saveOutputData << std::endl
<< " forwardSummary=" << forwardSummary << std::endl
<< " nblocks=" << numBlocks << std::endl
@ -648,6 +659,10 @@ int main(int argc, char* argv[])
filter.SetUseBoundaryExtremaOnly(useBoundaryExtremaOnly);
filter.SetUseMarchingCubes(useMarchingCubes);
filter.SetAugmentHierarchicalTree(augmentHierarchicalTree);
if (presimplifyThreshold > 0)
{
filter.SetPresimplifyThreshold(presimplifyThreshold);
}
filter.SetSaveDotFiles(saveDotFiles);
filter.SetActiveField("values");
@ -923,6 +938,7 @@ int main(int argc, char* argv[])
close(save_err);
}
std::cout << "DONE!!!" << std::endl;
// Finalize and finish the execution
MPI_Finalize();
return EXIT_SUCCESS;

@ -169,6 +169,7 @@ ContourTreeUniformDistributed::ContourTreeUniformDistributed(vtkm::cont::LogLeve
: UseBoundaryExtremaOnly(true)
, UseMarchingCubes(false)
, AugmentHierarchicalTree(false)
, PresimplifyThreshold(0)
, SaveDotFiles(false)
, TimingsLogLevel(timingsLogLevel)
, TreeLogLevel(treeLogLevel)
@ -1140,6 +1141,8 @@ VTKM_CONT void ContourTreeUniformDistributed::DoPostExecute(
{
master.foreach ([globalPointDimensions](DistributedContourTreeBlockData* blockData,
const vtkmdiy::Master::ProxyWithLink&) {
// TODO: Pass this->PresimplifyThreshold and DependentVolume array to HierarchicalAugmenter.Initialize if
// we want to presimplify the tree, i.e., if this->PresimplifyThreshold > 0
blockData->HierarchicalAugmenter.Initialize(
blockData->GlobalBlockId,
&blockData->HierarchicalTree,

@ -118,6 +118,11 @@ public:
this->AugmentHierarchicalTree = augmentHierarchicalTree;
}
VTKM_CONT void SetPresimplifyThreshold(vtkm::Id presimplifyThreshold)
{
this->PresimplifyThreshold = presimplifyThreshold;
}
VTKM_CONT void SetBlockIndices(vtkm::Id3 blocksPerDim,
const vtkm::cont::ArrayHandle<vtkm::Id3>& localBlockIndices)
{
@ -127,6 +132,8 @@ public:
VTKM_CONT bool GetAugmentHierarchicalTree() { return this->AugmentHierarchicalTree; }
VTKM_CONT vtkm::Id GetPresimplifyThreshold() { return this->PresimplifyThreshold; }
VTKM_CONT void SetSaveDotFiles(bool saveDotFiles) { this->SaveDotFiles = saveDotFiles; }
VTKM_CONT bool GetSaveDotFiles() { return this->SaveDotFiles; }
@ -188,6 +195,9 @@ private:
/// Augment hierarchical tree
bool AugmentHierarchicalTree;
/// Threshold to use for volume pre-simplification
vtkm::Id PresimplifyThreshold;
/// Save dot files for all tree computations
bool SaveDotFiles;