Added verification code to test results of contour tree app.

This commit is contained in:
Gunther H. Weber 2021-09-21 20:26:20 -07:00
parent 6849c6015d
commit 17a8cf16a2
3 changed files with 13 additions and 6 deletions

@ -84,5 +84,7 @@ if (VTKm_ENABLE_MPI)
configure_file(split_data_2d.py split_data_2d.py COPYONLY)
configure_file(split_data_3d.py split_data_3d.py COPYONLY)
configure_file(hact_test.sh hact_test.sh COPYONLY)
configure_file(hact_test_volume.sh hact_test_volume.sh COPYONLY)
configure_file(testrun.sh testrun.sh COPYONLY)
configure_file(testrun_volume.sh testrun_volume.sh COPYONLY)
endif()

@ -10,7 +10,7 @@ import operator
# Read a 3D text file from disk into a NumPy array
# ... Plain text
def read_file(fn):
data = np.fromfile(fn, dtype=np.float, sep=" ")
data = np.fromfile(fn, dtype=float, sep=" ")
data = data[3:].reshape((int(data[2]),int(data[0]),int(data[1])))
return data

@ -1194,8 +1194,8 @@ VTKM_CONT void ContourTreeUniformDistributed::DoPostExecute(
vtkm::Id totalVolume =
spatialDecomp.GlobalSize[0] * spatialDecomp.GlobalSize[1] * spatialDecomp.GlobalSize[2];
hierarchical_hyper_sweep_master.foreach (
[&totalVolume](vtkm::worklet::contourtree_distributed::HyperSweepBlock<FieldType>* b,
const vtkmdiy::Master::ProxyWithLink&) {
[&totalVolume, &rank](vtkm::worklet::contourtree_distributed::HyperSweepBlock<FieldType>* b,
const vtkmdiy::Master::ProxyWithLink&) {
std::cout << "Block " << b->BlockNo << std::endl;
std::cout << "=========" << std::endl;
vtkm::worklet::contourtree_augmented::PrintHeader(b->IntrinsicVolume.GetNumberOfValues(),
@ -1211,9 +1211,14 @@ VTKM_CONT void ContourTreeUniformDistributed::DoPostExecute(
vtkm::cont::LogLevel::Info,
b->HierarchicalContourTree.DebugPrint("Called from DumpVolumes", __FILE__, __LINE__));
#endif
VTKM_LOG_S(vtkm::cont::LogLevel::Info,
b->HierarchicalContourTree.DumpVolumes(
totalVolume, b->IntrinsicVolume, b->DependentVolume));
std::string dumpVolumesString = b->HierarchicalContourTree.DumpVolumes(
totalVolume, b->IntrinsicVolume, b->DependentVolume);
VTKM_LOG_S(vtkm::cont::LogLevel::Info, dumpVolumesString);
std::string volumesFileName = std::string("TreeWithVolumes_Rank_") +
std::to_string(static_cast<int>(rank)) + std::string("_Block_") +
std::to_string(static_cast<int>(b->BlockNo)) + std::string(".txt");
std::ofstream treeStream(volumesFileName.c_str());
treeStream << dumpVolumesString;
});
// Clean-up