Updated HierarchicalHyperSweeper to track instrinsic and dependent values

Updated HierarchicalHyperSweeper to track instrinsic and dependent values not just sweepValues
This commit is contained in:
Oliver Ruebel 2021-03-23 12:12:29 -07:00 committed by Gunther H. Weber
parent 9dbccaae1d
commit ec7a62a75b
8 changed files with 94 additions and 79 deletions

@ -86,9 +86,9 @@
#include <vtkm/worklet/contourtree_distributed/PrintGraph.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_hyper_sweeper/ComputeSuperarcDependentWeightsWorklet.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_hyper_sweeper/ComputeSuperarcTransferWeightsWorklet.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_hyper_sweeper/InitializeRegularVertexCountComputeSuperparentIdsWorklet.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_hyper_sweeper/InitializeRegularVertexCountInitalizeCountsWorklet.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_hyper_sweeper/InitializeRegularVertexCountSubtractLowEndWorklet.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_hyper_sweeper/InitializeIntrinsicVertexCountComputeSuperparentIdsWorklet.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_hyper_sweeper/InitializeIntrinsicVertexCountInitalizeCountsWorklet.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_hyper_sweeper/InitializeIntrinsicVertexCountSubtractLowEndWorklet.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_hyper_sweeper/TransferTargetComperator.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_hyper_sweeper/TransferWeightsUpdateLHEWorklet.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_hyper_sweeper/TransferWeightsUpdateRHEWorklet.h>
@ -116,7 +116,15 @@ public:
vtkm::Id BlockId;
// array of values being operated over (same size as supernode set)
const vtkm::cont::ArrayHandle<FieldType>& SweepValues;
// keep both intrinsic & dependent values
// the intrinsic values are just stored but not modifid here
const vtkm::cont::ArrayHandle<FieldType>& IntrinsicValues;
// the dependent values are what is being sweeped and are updated here
const vtkm::cont::ArrayHandle<FieldType>& DependentValues;
// and to avoid an extra log summation, store the number of logical nodes for the underlying block
// (computed when initializing the regular vertex list)
vtkm::Id NumOwnedRegularVertices;
// these are working arrays, lifted up here for ease of debug code
// Subranges of these arrays will be reused in the rounds / iterations rather than being reallocated
@ -132,12 +140,14 @@ public:
/// @param[in] blockId The Id of the base block (used for debug output)
/// @param[in] hierarchicalTree the tree that to hypersweeps over
/// @param[in] baseBlock the underlying mesh base block type
/// @param[in] sweepValues array of values being operated over (same size as supernode set)
/// @param[in] intrinsicValues array of values of intrinisic nodes are just being stored here but not modified
/// @param[in] dependentValues array of values being operated over (same size as supernode set)
HierarchicalHyperSweeper<MeshType, FieldType>(
vtkm::Id blockId,
const HierarchicalContourTree<FieldType>& hierarchicalTree,
const MeshType& baseBlock,
const vtkm::cont::ArrayHandle<FieldType>& sweepValues);
const vtkm::cont::ArrayHandle<FieldType>& intrinsicValues,
const vtkm::cont::ArrayHandle<FieldType>& dependentValues);
/// Our routines to initialize the sweep need to be static (or externa)l if we are going to use the constructor
/// to run the actual hypersweep
@ -145,7 +155,7 @@ public:
/// @param[in] baseBlock the underlying mesh base block to initialize from
/// @param[in] localToGlobalIdRelabeler Id relabeler used to compute global indices from local mesh indices
/// @param[out] superarcRegularCounts arrray for the output superarc regular counts
static void InitializeRegularVertexCount(
static void InitializeIntrinsicVertexCount(
const HierarchicalContourTree<FieldType>& hierarchicalTree,
const MeshType& baseBlock,
const vtkm::worklet::contourtree_augmented::mesh_dem::IdRelabeler* localToGlobalIdRelabeler,
@ -200,11 +210,14 @@ HierarchicalHyperSweeper<MeshType, FieldType>::HierarchicalHyperSweeper(
vtkm::Id blockId,
const HierarchicalContourTree<FieldType>& hierarchicalTree,
const MeshType& baseBlock,
const vtkm::cont::ArrayHandle<FieldType>& sweepValues)
const vtkm::cont::ArrayHandle<FieldType>& intrinsicValues,
const vtkm::cont::ArrayHandle<FieldType>& dependentValues)
: HierarchicalTree(hierarchicalTree)
, BaseBlock(baseBlock)
, BlockId(blockId)
, SweepValues(sweepValues)
, IntrinsicValues(intrinsicValues)
, DependentValues(dependentValues)
, NumOwnedRegularVertices(static_cast<vtkm::Id>(0))
{ // constructor
// Initalize arrays with 0s
vtkm::cont::ArrayHandleConstant<vtkm::Id> tempZeroArray(
@ -221,18 +234,19 @@ HierarchicalHyperSweeper<MeshType, FieldType>::HierarchicalHyperSweeper(
// static function used to compute the initial superarc regular counts
template <typename MeshType, typename FieldType>
void HierarchicalHyperSweeper<MeshType, FieldType>::InitializeRegularVertexCount(
void HierarchicalHyperSweeper<MeshType, FieldType>::InitializeIntrinsicVertexCount(
const HierarchicalContourTree<FieldType>& hierarchicalTree,
const MeshType& baseBlock,
const vtkm::worklet::contourtree_augmented::mesh_dem::IdRelabeler* localToGlobalIdRelabeler,
vtkm::worklet::contourtree_augmented::IdArrayType& superarcRegularCounts)
{ // InitializeRegularVertexCount()
// TODO: Implement this function
{ // InitializeIntrinsicVertexCount()
vtkm::cont::Invoker
localInvoke; // Needed because this a static function so we can't use the invoke from the object
// I. Call the mesh to get a list of all regular vertices belonging to the block by global Id
vtkm::worklet::contourtree_augmented::IdArrayType globalIds;
baseBlock.GetOwnedVerticesByGlobalId(localToGlobalIdRelabeler, globalIds);
// and store the size for later reference
hierarchicalTree.NumOwnedRegularVertices = globalIds.GetNumberOfValues();
#ifdef DEBUG_PRINT
{
@ -249,7 +263,7 @@ void HierarchicalHyperSweeper<MeshType, FieldType>::InitializeRegularVertexCount
{ // scope to make sure temporary variables are deleted
auto findRegularByGlobal = hierarchicalTree.GetFindRegularByGlobal();
auto computeSuperparentIdsWorklet = vtkm::worklet::contourtree_distributed::
hierarchical_hyper_sweeper::InitializeRegularVertexCountComputeSuperparentIdsWorklet();
hierarchical_hyper_sweeper::InitializeIntrinsicVertexCountComputeSuperparentIdsWorklet();
localInvoke(computeSuperparentIdsWorklet, // worklet to run
globalIds, // input
findRegularByGlobal, // input
@ -285,7 +299,7 @@ void HierarchicalHyperSweeper<MeshType, FieldType>::InitializeRegularVertexCount
superarcRegularCounts);
{ // scope to make sure temporary variables are deleted
vtkm::worklet::contourtree_distributed::hierarchical_hyper_sweeper::
InitializeRegularVertexCountInitalizeCountsWorklet initalizeCountsWorklet;
InitializeIntrinsicVertexCountInitalizeCountsWorklet initalizeCountsWorklet;
// set the count to the Id one off the high end of each range
localInvoke(initalizeCountsWorklet, // worklet
superparents, // input domain
@ -296,7 +310,7 @@ void HierarchicalHyperSweeper<MeshType, FieldType>::InitializeRegularVertexCount
// now repeat to subtract out the low end
{
vtkm::worklet::contourtree_distributed::hierarchical_hyper_sweeper::
InitializeRegularVertexCountSubtractLowEndWorklet subtractLowEndWorklet;
InitializeIntrinsicVertexCountSubtractLowEndWorklet subtractLowEndWorklet;
localInvoke(subtractLowEndWorklet, // worklet
superparents, // input domain
superarcRegularCounts // output
@ -311,7 +325,7 @@ void HierarchicalHyperSweeper<MeshType, FieldType>::InitializeRegularVertexCount
VTKM_LOG_S(vtkm::cont::LogLevel::Info, debugStream.str());
}
#endif
} // InitializeRegularVertexCount()
} // InitializeIntrinsicVertexCount()
// routine to do the local hypersweep using addition / subtraction
@ -422,18 +436,18 @@ void HierarchicalHyperSweeper<MeshType, FieldType>::ComputeSuperarcDependentWeig
// Same as std::partial_sum(sweepValues.begin() + firstSupernode, sweepValues.begin() + lastSupernode, valuePrefixSum.begin() + firstSupernode);
{
vtkm::Id numValuesToCopy = lastSupernode - firstSupernode;
// SweepValues[firstSuperNode, lastSupernode)
vtkm::cont::ArrayHandleView<vtkm::worklet::contourtree_augmented::IdArrayType> sweepValuesView(
this->SweepValues, // subset SweepValues
firstSupernode, // start at firstSupernode
numValuesToCopy); // until lastSuperNode (not inclued)
// DependentValues[firstSuperNode, lastSupernode)
vtkm::cont::ArrayHandleView<vtkm::worklet::contourtree_augmented::IdArrayType>
dependentValuesView(this->DependentValues, // subset DependentValues
firstSupernode, // start at firstSupernode
numValuesToCopy); // until lastSuperNode (not inclued)
// Target array
vtkm::cont::ArrayHandleView<vtkm::worklet::contourtree_augmented::IdArrayType>
valuePrefixSumView(this->ValuePrefixSum, // subset SweepValues
valuePrefixSumView(this->ValuePrefixSum, // subset ValuePrefixSum
firstSupernode, // start at firstSupernode
numValuesToCopy); // until lastSuperNode (not inclued)
// Compute the partial sum for SweepValues[firstSuperNode, lastSupernode) and write to ValuePrefixSum[firstSuperNode, lastSupernode)
vtkm::cont::Algorithm::ScanInclusive(sweepValuesView, // input
// Compute the partial sum for DependentValues[firstSuperNode, lastSupernode) and write to ValuePrefixSum[firstSuperNode, lastSupernode)
vtkm::cont::Algorithm::ScanInclusive(dependentValuesView, // input
valuePrefixSumView); // result of partial sum
}
@ -460,8 +474,8 @@ void HierarchicalHyperSweeper<MeshType, FieldType>::ComputeSuperarcDependentWeig
vtkm::cont::ArrayHandleView<vtkm::worklet::contourtree_augmented::IdArrayType>
hierarchicalTreeHypernodesView(
this->HierarchicalTree.Hypernodes, firstSupernode, numValuesToProcess);
vtkm::cont::ArrayHandleView<vtkm::worklet::contourtree_augmented::IdArrayType> sweepValuesView(
this->SweepValues, firstSupernode, numValuesToProcess);
vtkm::cont::ArrayHandleView<vtkm::worklet::contourtree_augmented::IdArrayType>
dependentValuesView(this->DependentValues, firstSupernode, numValuesToProcess);
// create the worklet
vtkm::worklet::contourtree_distributed::hierarchical_hyper_sweeper::
ComputeSuperarcDependentWeightsWorklet<FieldType>
@ -475,7 +489,7 @@ void HierarchicalHyperSweeper<MeshType, FieldType>::ComputeSuperarcDependentWeig
hierarchicalTreeHyperparentsView, // input view of hierarchicalTree.Hyperparents[firstSupernode, lastSupernode)
this->hierarchicalTree.Hypernodes, // input full hierarchicalTree.Hypernodes array
this->ValuePrefixSum, // input full ValuePrefixSum array
sweepValuesView // output view of sweepValues[firstSu
dependentValuesView // output view of sweepValues[firstSu
);
}
} // ComputeSuperarcDependentWeights()
@ -562,10 +576,10 @@ void HierarchicalHyperSweeper<MeshType, FieldType>::ComputeSuperarcTransferWeigh
// copy transfer weight in the sorted order
vtkm::cont::ArrayHandleView<vtkm::worklet::contourtree_augmented::IdArrayType>
valuePrefixSumView(this->ValuePrefixSum, firstSupernode, numValuesToProcess);
auto permutedSweepValues =
vtkm::cont::make_ArrayHandlePermutation(superSortPermuteView, // idArray
this->SweepValues); // valueArray
vtkm::cont::Algorithm::Copy(permutedSweepValues, valuePrefixSumView);
auto permutedDependentValues =
vtkm::cont::make_ArrayHandlePermutation(superSortPermuteView, // idArray
this->DependentValues); // valueArray
vtkm::cont::Algorithm::Copy(permutedDependentValues, valuePrefixSumView);
}
} // ComputeSuperarcTransferWeights()
@ -596,15 +610,13 @@ void HierarchicalHyperSweeper<MeshType, FieldType>::TransferWeights(vtkm::Id rou
// back into our valuePrefixSumView at the end
vtkm::cont::ArrayHandle<FieldType> tempScanInclusiveTarget;
tempScanInclusiveTarget.Allocate(numValuesToCopy);
// Compute the partial sum for SweepValues[firstSuperNode, lastSupernode) and write to ValuePrefixSum[firstSuperNode, lastSupernode)
// Compute the partial sum for DependentValues[firstSuperNode, lastSupernode) and write to ValuePrefixSum[firstSuperNode, lastSupernode)
vtkm::cont::Algorithm::ScanInclusive(valuePrefixSumView, // input
tempScanInclusiveTarget); // result of partial sum
// Now copy the values from our prefix sum back
vtkm::cont::Algorithm::Copy(tempScanInclusiveTarget, valuePrefixSumView);
}
// 7a. and 7b.
{
// Prepare the approbriate array views for our worklet. This is done to allow us to
@ -624,7 +636,7 @@ void HierarchicalHyperSweeper<MeshType, FieldType>::TransferWeights(vtkm::Id rou
valuePrefixSumShiftedView(this->ValuePrefixSum, firstSupernode - 1, numValuesToProcess);
auto sweepValuePermuted =
vtkm::cont::make_ArrayHandlePermutation(sortedTransferTargetView, // idArray
this->SweepValues); // valueArray
this->DependentValues); // valueArray
// 7a. Find the RHE of each group and transfer the prefix sum weight
// Note that we do not compute the transfer weight separately, we add it in place instead
@ -672,9 +684,12 @@ std::string HierarchicalHyperSweeper<MeshType, FieldType>::DebugPrint(std::strin
resultStream << "----------------------------------------" << std::endl;
resultStream << std::endl;
vtkm::worklet::contourtree_augmented::PrintHeader(this->SweepValues.GetNumberOfValues(),
vtkm::worklet::contourtree_augmented::PrintHeader(this->DependentValues.GetNumberOfValues(),
resultStream);
vtkm::worklet::contourtree_augmented::PrintIndices("Volume", this->SweepValues, -1, resultStream);
vtkm::worklet::contourtree_augmented::PrintIndices(
"Intrinsic", this->IntrinsicValues, -1, resultStream);
vtkm::worklet::contourtree_augmented::PrintIndices(
"Dependent", this->DependentValues, -1, resultStream);
vtkm::worklet::contourtree_augmented::PrintIndices(
"Prefix Sum", this->ValuePrefixSum - 1, resultStream);
vtkm::worklet::contourtree_augmented::PrintIndices(
@ -700,7 +715,7 @@ void HierarchicalHyperSweeper<MeshType, FieldType>::SaveHierarchicalContourTreeD
SHOW_SUPER_STRUCTURE | SHOW_HYPER_STRUCTURE | SHOW_ALL_IDS | SHOW_ALL_SUPERIDS |
SHOW_ALL_HYPERIDS | SHOW_EXTRA_DATA, //|GV_NODE_NAME_USES_GLOBAL_ID
this->BlockId,
this->SweepValues);
this->DependentValues);
std::ofstream hierarchicalTreeFile(outFileName);
hierarchicalTreeFile << hierarchicalTreeDotString;
} // SaveHierarchicalContourTreeDot

@ -9,9 +9,9 @@
##============================================================================
set(headers
InitializeRegularVertexCountComputeSuperparentIds.h
InitializeRegularVertexCountInitalizeCountsWorklet.h
InitializeRegularVertexCountSubtractLowEndWorklet.h
InitializeIntrinsicVertexCountComputeSuperparentIds.h
InitializeIntrinsicVertexCountInitalizeCountsWorklet.h
InitializeIntrinsicVertexCountSubtractLowEndWorklet.h
ComputeSuperarcDependentWeightsWorklet.h
ComputeSuperarcTransferWeightsWorklet.h
TransferTargetComperator.h

@ -79,7 +79,7 @@ public:
hierarchicalTreeHyperparentsView, // view of hierarchicalTree.Hyperparents[firstSupernode, lastSupernode)
WholeArrayIn hierarchicalTreeHypernodes, // whole hierarchicalTree.Hypernodes array
WholeArrayIn valuePrefixSum, // whole valuePrefixSum array
FieldInOut sweepValuesView // output view of sweepValues[firstSupernode, lastSupernode)
FieldInOut dependentValuesView // output view of dependentValues[firstSupernode, lastSupernode)
);
using ExecutionSignature = void(InputIndex, _1, _2);
using InputDomain = _1;
@ -102,7 +102,7 @@ public:
const vtkm::Id& hyperparent, // same as hierarchicalTree.hyperparents[supernode];
const InFieldPortalType& hierarchicalTreeHypernodesPortal,
const InFieldPortalType& valuePrefixSumPortal,
vtkm::Id& sweepValue) const
vtkm::Id& dependentValue) const
{
// per supernode
// if there is no superarc, it is either the root of the tree or an attachment point
@ -113,19 +113,19 @@ public:
{ // global root
// this is guaranteed to be the only element in it's iteration
// so the prefix sum is good as it stands
sweepValue = valuePrefixSumPortal.Get(supernode);
dependentValue = valuePrefixSumPortal.Get(supernode);
} // global root
else
{ // attachment point
// could be the first in the iteration, in which case it is correct
if (supernode == this->FirstSupernode)
{
sweepValue = valuePrefixSumPortal.Get(supernode);
dependentValue = valuePrefixSumPortal.Get(supernode);
}
// otherwise, we are guaranteed that it's a length one chain, so subtract predecessor
else
{
sweepValue =
dependentValue =
valuePrefixSumPortal.Get(supernode) - valuePrefixSumPortal.Get(supernode - 1);
}
} // attachment point
@ -142,7 +142,7 @@ public:
baseValue = valuePrefixSumPortal.Get(hyperparentSuperId - 1);
}
// for all others, remove the hyperparent's prefix sum to get the "relative" prefix sum
sweepValue = valuePrefixSumPortal.Get(supernode) - baseValue;
dependentValue = valuePrefixSumPortal.Get(supernode) - baseValue;
} // actual superarc
// In serial this worklet implements the following operation
@ -160,16 +160,16 @@ public:
{ // global root
// this is guaranteed to be the only element in it's iteration
// so the prefix sum is good as it stands
sweepValues[supernode] = valuePrefixSum[supernode];
dependentValues[supernode] = valuePrefixSum[supernode];
} // global root
else
{ // attachment point
// could be the first in the iteration, in which case it is correct
if (supernode == firstSupernode)
sweepValues[supernode] = valuePrefixSum[supernode];
dependentValues[supernode] = valuePrefixSum[supernode];
// otherwise, we are guaranteed that it's a length one chain, so subtract predecessor
else
sweepValues[supernode] = valuePrefixSum[supernode] - valuePrefixSum[supernode-1];
dependentValues[supernode] = valuePrefixSum[supernode] - valuePrefixSum[supernode-1];
} // attachment point
} // null superarc
else
@ -184,7 +184,7 @@ public:
baseValue = valuePrefixSum[hyperparentSuperId - 1];
// for all others, remove the hyperparent's prefix sum to get the "relative" prefix sum
sweepValues[supernode] = valuePrefixSum[supernode] - baseValue;
dependentValues[supernode] = valuePrefixSum[supernode] - baseValue;
} // actual superarc
} // per supernode
*/

@ -50,8 +50,8 @@
// Oliver Ruebel (LBNL)
//==============================================================================
#ifndef vtk_m_worklet_contourtree_distributed_hierarchical_hyper_sweeper_initialize_regular_vertex_count_compute_superparent_ids_worklet_h
#define vtk_m_worklet_contourtree_distributed_hierarchical_hyper_sweeper_initialize_regular_vertex_count_compute_superparent_ids_worklet_h
#ifndef vtk_m_worklet_contourtree_distributed_hierarchical_hyper_sweeper_initialize_intrinsic_vertex_count_compute_superparent_ids_worklet_h
#define vtk_m_worklet_contourtree_distributed_hierarchical_hyper_sweeper_initialize_intrinsic_vertex_count_compute_superparent_ids_worklet_h
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree_augmented/Types.h>
@ -65,9 +65,9 @@ namespace contourtree_distributed
namespace hierarchical_hyper_sweeper
{
/// Worklet used in HierarchicalHyperSweeper.InitializeRegularVertexCount(...) to
/// Worklet used in HierarchicalHyperSweeper.InitializeIntrinsicVertexCount(...) to
/// Look up the global Ids in the hierarchical tree & convert to superparent Ids
class InitializeRegularVertexCountComputeSuperparentIdsWorklet
class InitializeIntrinsicVertexCountComputeSuperparentIdsWorklet
: public vtkm::worklet::WorkletMapField
{
public:
@ -84,7 +84,7 @@ public:
// Default Constructor
VTKM_EXEC_CONT
InitializeRegularVertexCountComputeSuperparentIdsWorklet() {}
InitializeIntrinsicVertexCountComputeSuperparentIdsWorklet() {}
template <typename ExecObjType, typename InFieldPortalType>
VTKM_EXEC vtkm::Id operator()(const vtkm::Id& globalId,
@ -150,7 +150,7 @@ public:
*/
} // operator()()
}; // InitializeRegularVertexCountComputeSuperparentIdsWorklet
}; // InitializeIntrinsicVertexCountComputeSuperparentIdsWorklet
} // namespace hierarchical_hyper_sweeper
} // namespace contourtree_distributed

@ -50,8 +50,8 @@
// Oliver Ruebel (LBNL)
//==============================================================================
#ifndef vtk_m_worklet_contourtree_distributed_hierarchical_hyper_sweeper_initialize_regular_vertex_count_initialize_counts_worklet_h
#define vtk_m_worklet_contourtree_distributed_hierarchical_hyper_sweeper_initialize_regular_vertex_count_initialize_counts_worklet_h
#ifndef vtk_m_worklet_contourtree_distributed_hierarchical_hyper_sweeper_initialize_intrinsic_vertex_count_initialize_counts_worklet_h
#define vtk_m_worklet_contourtree_distributed_hierarchical_hyper_sweeper_initialize_intrinsic_vertex_count_initialize_counts_worklet_h
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree_augmented/Types.h>
@ -65,9 +65,9 @@ namespace contourtree_distributed
namespace hierarchical_hyper_sweeper
{
/// Worklet used in HierarchicalHyperSweeper.InitializeRegularVertexCount(...) to
/// Worklet used in HierarchicalHyperSweeper.InitializeIntrinsicVertexCount(...) to
/// set the count to the Id one off the high end of each range
class InitializeRegularVertexCountInitalizeCountsWorklet : public vtkm::worklet::WorkletMapField
class InitializeIntrinsicVertexCountInitalizeCountsWorklet : public vtkm::worklet::WorkletMapField
{
public:
using ControlSignature = void(WholeArrayIn superparents, WholeArrayInOut superarcRegularCounts);
@ -76,7 +76,7 @@ public:
// Default Constructor
VTKM_EXEC_CONT
InitializeRegularVertexCountInitalizeCountsWorklet() {}
InitializeIntrinsicVertexCountInitalizeCountsWorklet() {}
template <typename InFieldPortalType, typename InOutFieldPortalType>
VTKM_EXEC void operator()(const vtkm::Id& vertex,
@ -128,7 +128,7 @@ public:
*/
} // operator()()
}; // InitializeRegularVertexCountInitalizeCountsWorklet
}; // InitializeIntrinsicVertexCountInitalizeCountsWorklet
} // namespace hierarchical_hyper_sweeper
} // namespace contourtree_distributed

@ -50,8 +50,8 @@
// Oliver Ruebel (LBNL)
//==============================================================================
#ifndef vtk_m_worklet_contourtree_distributed_hierarchical_hyper_sweeper_initialize_regular_vertex_count_subtract_low_end_worklet_h
#define vtk_m_worklet_contourtree_distributed_hierarchical_hyper_sweeper_initialize_regular_vertex_count_subtract_low_end_worklet_h
#ifndef vtk_m_worklet_contourtree_distributed_hierarchical_hyper_sweeper_initialize_intrinsic_vertex_count_subtract_low_end_worklet_h
#define vtk_m_worklet_contourtree_distributed_hierarchical_hyper_sweeper_initialize_intrinsic_vertex_count_subtract_low_end_worklet_h
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree_augmented/Types.h>
@ -65,9 +65,9 @@ namespace contourtree_distributed
namespace hierarchical_hyper_sweeper
{
/// Worklet used in HierarchicalHyperSweeper.InitializeRegularVertexCount(...) to
/// Worklet used in HierarchicalHyperSweeper.InitializeIntrinsicVertexCount(...) to
/// subtract out the low end from the superarc regular counts
class InitializeRegularVertexCountSubtractLowEndWorklet : public vtkm::worklet::WorkletMapField
class InitializeIntrinsicVertexCountSubtractLowEndWorklet : public vtkm::worklet::WorkletMapField
{
public:
using ControlSignature = void(WholeArrayIn superparents, WholeArrayInOut superarcRegularCounts);
@ -76,7 +76,7 @@ public:
// Default Constructor
VTKM_EXEC_CONT
InitializeRegularVertexCountSubtractLowEndWorklet() {}
InitializeIntrinsicVertexCountSubtractLowEndWorklet() {}
template <typename InFieldPortalType, typename InOutFieldPortalType>
VTKM_EXEC void operator()(const vtkm::Id& vertex,
@ -131,7 +131,7 @@ public:
*/
} // operator()()
}; // InitializeRegularVertexCountSubtractLowEndWorklet
}; // InitializeIntrinsicVertexCountSubtractLowEndWorklet
} // namespace hierarchical_hyper_sweeper
} // namespace contourtree_distributed

@ -79,7 +79,7 @@ public:
FieldIn
valuePrefixSumShiftedView, // input view of valuePrefixSum[firstSupernode-1, lastSupernode-1)
FieldInOut
sweepValuePermuted // output view of sweepValues permuted by sortedTransferTarget[firstSupernode, lastSupernode). Use FieldInOut since we don't overwrite all values.
dependentValuePermuted // output view of dependentValues permuted by sortedTransferTarget[firstSupernode, lastSupernode). Use FieldInOut since we don't overwrite all values.
);
using ExecutionSignature = void(_1, _2, _3, _4, _5);
using InputDomain = _1;
@ -96,7 +96,7 @@ public:
const vtkm::Id& sortedTransferTargetValue, // same as sortedTransferTarget[supernode]
const vtkm::Id& sortedTransferTargetNextValue, // same as sortedTransferTarget[supernode+1]
const vtkm::Id& valuePrefixSumPreviousValue, // same as valuePrefixSum[supernode-1]
vtkm::Id& sweepValue // same as sweepValues[sortedTransferTarget[supernode]]
vtkm::Id& dependentValue // same as dependentValues[sortedTransferTarget[supernode]]
) const
{
// per supernode
@ -110,11 +110,11 @@ public:
// occur, but let's keep the logic strict
if (supernode == this->FirstSupernode)
{ // LHE 0
sweepValue -= 0;
dependentValue -= 0;
} // LHE 0
else if (sortedTransferTargetValue != sortedTransferTargetNextValue)
{ // LHE not 0
sweepValue -= valuePrefixSumPreviousValue;
dependentValue -= valuePrefixSumPreviousValue;
} // LHE not 0
// In serial this worklet implements the following operation
@ -129,11 +129,11 @@ public:
// occur, but let's keep the logic strict
if (supernode == firstSupernode)
{ // LHE 0
sweepValues[sortedTransferTarget[supernode]] -= 0;
dependentValues[sortedTransferTarget[supernode]] -= 0;
} // LHE 0
else if (sortedTransferTarget[supernode] != sortedTransferTarget[supernode-1])
{ // LHE not 0
sweepValues[sortedTransferTarget[supernode]] -= valuePrefixSum[supernode-1];
dependentValues[sortedTransferTarget[supernode]] -= valuePrefixSum[supernode-1];
} // LHE not 0
} // per supernode
*/

@ -79,7 +79,7 @@ public:
sortedTransferTargetShiftedView, // input view of sortedTransferTarget[firstSupernode+1, lastSupernode+1)
FieldIn valuePrefixSumView, // input view of valuePrefixSum[firstSupernode, lastSupernode)
FieldInOut
sweepValuePermuted // output view of sweepValues permuted by sortedTransferTarget[firstSupernode, lastSupernode). Use FieldInOut since we don't overwrite all values.
dependentValuePermuted // output view of dependentValues permuted by sortedTransferTarget[firstSupernode, lastSupernode). Use FieldInOut since we don't overwrite all values.
);
using ExecutionSignature = void(_1, _2, _3, _4, _5);
using InputDomain = _1;
@ -96,7 +96,7 @@ public:
const vtkm::Id& sortedTransferTargetValue, // same as sortedTransferTarget[supernode]
const vtkm::Id& sortedTransferTargetNextValue, // same as sortedTransferTarget[supernode+1]
const vtkm::Id& valuePrefixSum, // same as valuePrefixSum[supernode]
vtkm::Id& sweepValue // same as sweepValues[sortedTransferTarget[supernode]]
vtkm::Id& dependentValue // same as dependentValues[sortedTransferTarget[supernode]]
) const
{
// per supernode
@ -109,7 +109,7 @@ public:
if ((supernode == this->LastSupernode - 1) ||
(sortedTransferTargetValue != sortedTransferTargetNextValue))
{ // RHE of segment
sweepValue += valuePrefixSum;
dependentValue += valuePrefixSum;
} // RHE of segment
// In serial this worklet implements the following operation
@ -123,7 +123,7 @@ public:
// the RHE of each segment transfers its weight (including all irrelevant prefixes)
if ((supernode == lastSupernode - 1) || (sortedTransferTarget[supernode] != sortedTransferTarget[supernode+1]))
{ // RHE of segment
sweepValues[sortedTransferTarget[supernode]] += valuePrefixSum[supernode];
dependentValues[sortedTransferTarget[supernode]] += valuePrefixSum[supernode];
} // RHE of segment
} // per supernode
*/