Fix bad array size in HierarchicalAugmenter.RetrieveOldSupernodes

This commit is contained in:
Oliver Ruebel 2021-07-28 11:13:47 -07:00 committed by Gunther H. Weber
parent 51a7304318
commit 4c7eb4045c

@ -853,10 +853,9 @@ void HierarchicalAugmenter<FieldType>::RetrieveOldSupernodes(vtkm::Id roundNumbe
vtkm::Id supernodeIndexBase = vtkm::Id supernodeIndexBase =
vtkm::cont::ArrayGetValue(0, this->BaseTree->FirstSupernodePerIteration[roundNumber]); vtkm::cont::ArrayGetValue(0, this->BaseTree->FirstSupernodePerIteration[roundNumber]);
vtkm::cont::ArrayHandleCounting<vtkm::Id> supernodeIdVals( vtkm::cont::ArrayHandleCounting<vtkm::Id> supernodeIdVals(
supernodeIndexBase, // start supernodeIndexBase, // start
1, // step 1, // step
this->KeptSupernodes.GetNumberOfValues() // array size this->BaseTree->NumSupernodesInRound.ReadPortal().Get(roundNumber));
);
// the test for whether to keep it is: // the test for whether to keep it is:
// a1. at the top level, keep everything // a1. at the top level, keep everything
if (!(roundNumber < this->BaseTree->NumRounds)) if (!(roundNumber < this->BaseTree->NumRounds))
@ -1098,7 +1097,7 @@ void HierarchicalAugmenter<FieldType>::ResizeArrays(vtkm::Id roundNumber)
supernodeIndex, // input domain. We only need the index because supernodeIdSetPermuted already does the permute supernodeIndex, // input domain. We only need the index because supernodeIdSetPermuted already does the permute
supernodeIdSetPermuted, // input input supernodeIDSet permuted by supernodeSorter to allow for FieldIn supernodeIdSetPermuted, // input input supernodeIDSet permuted by supernodeSorter to allow for FieldIn
this this
->NewSupernodeIds // output/input (both are necessary since not all valyes will be overwritten) ->NewSupernodeIds // output/input (both are necessary since not all values will be overwritten)
); );
} }
@ -1303,10 +1302,10 @@ std::string HierarchicalAugmenter<FieldType>::DebugPrint(std::string message,
<< std::endl; << std::endl;
resultStream << "----------------------------------------" << std::endl; resultStream << "----------------------------------------" << std::endl;
resultStream << this->BaseTree->DebugPrint( //resultStream << this->BaseTree->DebugPrint(
(message + std::string(" Base Tree")).c_str(), fileName, lineNum); // (message + std::string(" Base Tree")).c_str(), fileName, lineNum);
resultStream << this->AugmentedTree->DebugPrint( //resultStream << this->AugmentedTree->DebugPrint(
(message + std::string(" Augmented Tree")).c_str(), fileName, lineNum); // (message + std::string(" Augmented Tree")).c_str(), fileName, lineNum);
resultStream << "========================================" << std::endl; resultStream << "========================================" << std::endl;
resultStream << "Local List of Attachment Points" << std::endl; resultStream << "Local List of Attachment Points" << std::endl;
vtkm::worklet::contourtree_augmented::PrintHeader(this->GlobalRegularIds.GetNumberOfValues()); vtkm::worklet::contourtree_augmented::PrintHeader(this->GlobalRegularIds.GetNumberOfValues());