VTK-m  2.0
ComputeDistributedContourTreeFunctor.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 // Copyright (c) 2018, The Regents of the University of California, through
11 // Lawrence Berkeley National Laboratory (subject to receipt of any required approvals
12 // from the U.S. Dept. of Energy). All rights reserved.
13 //
14 // Redistribution and use in source and binary forms, with or without modification,
15 // are permitted provided that the following conditions are met:
16 //
17 // (1) Redistributions of source code must retain the above copyright notice, this
18 // list of conditions and the following disclaimer.
19 //
20 // (2) Redistributions in binary form must reproduce the above copyright notice,
21 // this list of conditions and the following disclaimer in the documentation
22 // and/or other materials provided with the distribution.
23 //
24 // (3) Neither the name of the University of California, Lawrence Berkeley National
25 // Laboratory, U.S. Dept. of Energy nor the names of its contributors may be
26 // used to endorse or promote products derived from this software without
27 // specific prior written permission.
28 //
29 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
30 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
31 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
32 // IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
33 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
36 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
37 // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
38 // OF THE POSSIBILITY OF SUCH DAMAGE.
39 //
40 //=============================================================================
41 //
42 // This code is an extension of the algorithm presented in the paper:
43 // Parallel Peak Pruning for Scalable SMP Contour Tree Computation.
44 // Hamish Carr, Gunther Weber, Christopher Sewell, and James Ahrens.
45 // Proceedings of the IEEE Symposium on Large Data Analysis and Visualization
46 // (LDAV), October 2016, Baltimore, Maryland.
47 //
48 // The PPP2 algorithm and software were jointly developed by
49 // Hamish Carr (University of Leeds), Gunther H. Weber (LBNL), and
50 // Oliver Ruebel (LBNL)
51 //==============================================================================
52 
53 #ifndef vtk_m_worklet_contourtree_distributed_computedistributedcontourtreefunctor_h
54 #define vtk_m_worklet_contourtree_distributed_computedistributedcontourtreefunctor_h
55 
56 #include <vtkm/Types.h>
57 #include <vtkm/cont/Error.h>
62 
63 // clang-format off
64 VTKM_THIRDPARTY_PRE_INCLUDE
65 #include <vtkm/thirdparty/diy/diy.h>
66 VTKM_THIRDPARTY_POST_INCLUDE
67 // clang-format on
68 
69 
70 namespace vtkm
71 {
72 namespace worklet
73 {
74 namespace contourtree_distributed
75 {
76 
78 template <typename FieldType>
80 {
81 public:
89  vtkm::Id3 globalSize,
90  bool useBoundaryExtremaOnly,
93  : GlobalSize(globalSize)
94  , UseBoundaryExtremaOnly(useBoundaryExtremaOnly)
95  , TimingsLogLevel(timingsLogLevel)
96  , TreeLogLevel(treeLogLevel)
97  {
98  }
99 
106  const vtkmdiy::ReduceProxy& rp,
107  const vtkmdiy::RegularSwapPartners&) const
108  {
109  // Track timing of main steps
110  vtkm::cont::Timer totalTimer; // Total time for each call
111  totalTimer.Start();
112  vtkm::cont::Timer timer; // Time individual steps
113  timer.Start();
114  std::stringstream timingsStream;
115 
116  // Get our rank and DIY id
118  const auto selfid = rp.gid();
119 
120  // Here we do the deque first before the send due to the way the iteration is handled in DIY, i.e., in each iteration
121  // A block needs to first collect the data from its neighours and then send the combined block to its neighbours
122  // for the next iteration.
123  // 1. dequeue the block and compute the new contour tree and contour tree mesh for the block if we have the hight GID
124  std::vector<int> incoming;
125  rp.incoming(incoming);
126  // log the time for getting the data from DIY
127  timingsStream << " " << std::setw(38) << std::left << "DIY Incoming Data"
128  << ": " << timer.GetElapsedTime() << " seconds" << std::endl;
129  timer.Start();
130 
131  // Compute the joint contour tree
132  for (const int ingid : incoming)
133  {
134  // NOTE/IMPORTANT: In each round we should have only one swap partner (despite for-loop here).
135  // If that assumption does not hold, it will break things.
136  // NOTE/IMPORTANT: This assumption only holds if the number of blocks is a power of two.
137  // Otherwise, we may need to process more than one incoming block
138  if (ingid != selfid)
139  {
140  vtkm::cont::Timer loopTimer; // time the steps of this loop
141  loopTimer.Start();
142 
143  vtkm::Id3 otherBlockOrigin;
144  rp.dequeue(ingid, otherBlockOrigin);
145  vtkm::Id3 otherBlockSize;
146  rp.dequeue(ingid, otherBlockSize);
148  rp.dequeue(ingid, otherContourTreeMesh);
149 
150  timingsStream << " Subphase of Merge Block" << std::endl;
151  timingsStream << " |-->" << std::setw(38) << std::left << "DIY Deque Data"
152  << ": " << loopTimer.GetElapsedTime() << " seconds" << std::endl;
153  loopTimer.Start();
154 
155 #ifdef DEBUG_PRINT_CTUD
157  "Local block has extents: " << block->BlockOrigin << " " << block->BlockSize
158  << std::endl
159  << "Combining with block received from ID " << ingid
160  << " with extents: " << otherBlockOrigin << " "
161  << otherBlockSize << std::endl);
162 #endif
163 
164  // Merge the two contour tree meshes
165  std::stringstream mergeMessageStream;
166  mergeMessageStream << " Rank : " << rank << std::endl
167  << " DIY Id : " << selfid << std::endl
168  << " Other Id: " << ingid << std::endl
169  << " Round : " << rp.round() << std::endl;
170  block->ContourTreeMeshes.back().MergeWith(
171  otherContourTreeMesh, this->TimingsLogLevel, mergeMessageStream.str());
172 
173  timingsStream << " |-->" << std::setw(38) << std::left << "Merge Contour Tree Mesh"
174  << ": " << loopTimer.GetElapsedTime() << " seconds" << std::endl;
175  loopTimer.Start();
176 
177 #ifdef DEBUG_PRINT_CTUD
178  // save the corresponding .gv file for the contour tree mesh
179  std::string contourTreeMeshFileName = std::string("Rank_") +
180  std::to_string(static_cast<int>(rank)) + std::string("_Block_") +
181  std::to_string(static_cast<int>(block->LocalBlockNo)) + "_Round_" +
182  std::to_string(rp.round()) + "_Partner_" + std::to_string(ingid) +
183  std::string("_Step_0_Combined_Mesh.gv");
184  std::string contourTreeMeshLabel = std::string("Block ") +
185  std::to_string(static_cast<int>(block->LocalBlockNo)) + " Round " +
186  std::to_string(rp.round()) + " Partner " + std::to_string(ingid) +
187  std::string(" Step 0 Combined Mesh");
188  std::string contourTreeMeshString =
189  vtkm::worklet::contourtree_distributed::ContourTreeMeshDotGraphPrint<FieldType>(
190  contourTreeMeshLabel,
191  block->ContourTreeMeshes.back(),
193  std::ofstream contourTreeMeshFile(contourTreeMeshFileName);
194  contourTreeMeshFile << contourTreeMeshString;
195  timingsStream << " |-->" << std::setw(38) << std::left
196  << "Save Contour Tree Mesh Dot"
197  << ": " << loopTimer.GetElapsedTime() << " seconds" << std::endl;
198  loopTimer.Start();
199 #endif
200 
201  // Compute the origin and size of the new block
202  vtkm::Id3 currBlockOrigin{
203  std::min(otherBlockOrigin[0], block->BlockOrigin[0]),
204  std::min(otherBlockOrigin[1], block->BlockOrigin[1]),
205  std::min(otherBlockOrigin[2], block->BlockOrigin[2]),
206  };
207  vtkm::Id3 currBlockMaxIndex{ // Needed only to compute the block size
208  std::max(otherBlockOrigin[0] + otherBlockSize[0],
209  block->BlockOrigin[0] + block->BlockSize[0]),
210  std::max(otherBlockOrigin[1] + otherBlockSize[1],
211  block->BlockOrigin[1] + block->BlockSize[1]),
212  std::max(otherBlockOrigin[2] + otherBlockSize[2],
213  block->BlockOrigin[2] + block->BlockSize[2])
214  };
215  vtkm::Id3 currBlockSize{ currBlockMaxIndex[0] - currBlockOrigin[0],
216  currBlockMaxIndex[1] - currBlockOrigin[1],
217  currBlockMaxIndex[2] - currBlockOrigin[2] };
218 
219  // Compute the contour tree from our merged mesh
220  vtkm::Id currNumIterations;
221  block->ContourTrees.emplace_back(); // Create new empty contour tree object
224  worklet.TimingsLogLevel =
225  vtkm::cont::LogLevel::Off; // disable the print logging, we'll print this later
226  vtkm::Id3 maxIdx{ currBlockOrigin[0] + currBlockSize[0] - 1,
227  currBlockOrigin[1] + currBlockSize[1] - 1,
228  currBlockOrigin[2] + currBlockSize[2] - 1 };
229  auto meshBoundaryExecObj = block->ContourTreeMeshes.back().GetMeshBoundaryExecutionObject(
230  this->GlobalSize, currBlockOrigin, maxIdx);
231  try
232  {
233  worklet.Run(block->ContourTreeMeshes.back()
234  .SortedValues, // Unused param. Provide something to keep the API happy
235  block->ContourTreeMeshes.back(),
236  block->ContourTrees.back(),
237  currSortOrder,
238  currNumIterations,
239  1, // Fully augmented
240  meshBoundaryExecObj);
241  }
242  // In case the contour tree got stuck, expand the debug information from
243  // the message to check whether we combined bad blocks
244  catch (const vtkm::cont::ErrorInternal& ex)
245  {
246  std::stringstream ex_message;
247  ex_message << ex.what();
248  ex_message << " Self/In DIY Id=(" << selfid << ", " << ingid << ")";
249  ex_message << " Rank=" << rank << " Round=" << rp.round();
250  ex_message << " Origin Self=(" << block->BlockOrigin[0] << ", " << block->BlockOrigin[1]
251  << ", " << block->BlockOrigin[2] << ")";
252  ex_message << " Origin In=(" << otherBlockOrigin[0] << ", " << otherBlockOrigin[1] << ", "
253  << otherBlockOrigin[2] << ")";
254  ex_message << " Origin Comb=(" << currBlockOrigin[0] << ", " << currBlockOrigin[1] << ", "
255  << currBlockOrigin[2] << ")";
256  ex_message << " Size Self=(" << block->BlockSize[0] << ", " << block->BlockSize[1] << ", "
257  << block->BlockSize[2] << ")";
258  ex_message << " Size In=(" << otherBlockSize[0] << ", " << otherBlockSize[1] << ", "
259  << otherBlockSize[2] << ")";
260  ex_message << " Size Comb=(" << currBlockSize[0] << ", " << currBlockSize[1] << ", "
261  << currBlockSize[2] << ")";
262  std::throw_with_nested(vtkm::cont::ErrorInternal(ex_message.str()));
263  }
264 
265  // Update block extents
266  block->BlockOrigin = currBlockOrigin;
267  block->BlockSize = currBlockSize;
268 
269  timingsStream << " |-->" << std::setw(38) << std::left
270  << "Compute Joint Contour Tree"
271  << ": " << loopTimer.GetElapsedTime() << " seconds" << std::endl;
272  loopTimer.Start();
273 
274 #ifdef DEBUG_PRINT_CTUD
275  /*
276  // TODO: GET THIS COMPILING. NEED TO LIKELY PUT THIS IN A SEPARATE FUNCTION TO GET THE STORAGE TYPE TEMPLATE PARAMETER
277  // TODO/FIXME: At this time we should only be dealing with contour tree meshes and not possibly other mesh types,
278  // and block does not have a Meshes member. Shouldn't this all be ContourTreeMesh instead?
279  // and the ones for the contour tree regular and superstructures
280  std::string regularStructureFileName = std::string("Rank_") +
281  std::to_string(static_cast<int>(rank)) + std::string("_Block_") +
282  std::to_string(static_cast<int>(block->LocalBlockNo)) + "_Round_" +
283  std::to_string(rp.round()) + " Partner " + std::to_string(ingid) +
284  std::string("_Step_1_Contour_Tree_Regular_Structure.gv");
285  std::string regularStructureLabel = std::string("Block ") +
286  std::to_string(static_cast<int>(block->LocalBlockNo)) + " Round " +
287  std::to_string(rp.round()) + " Partner " + std::to_string(ingid) +
288  std::string(" Step 1 Contour Tree Regular Structure");
289  std::string regularStructureString =
290  worklet::contourtree_distributed::ContourTreeDotGraphPrint < FieldType,
291  MeshType,
292  vtkm::worklet::contourtree_augmented::IdArrayType()(
293  regularStructureLabel,
294  block->Meshes.back(),
295  block->ContourTrees.back(),
296  worklet::contourtree_distributed::SHOW_REGULAR_STRUCTURE |
297  worklet::contourtree_distributed::SHOW_ALL_IDS);
298  std::ofstream regularStructureFile(regularStructureFileName);
299  regularStructureFile << regularStructureString;
300 
301  std::string superStructureFileName = std::string("Rank_") +
302  std::to_string(static_cast<int>(rank)) + std::string("_Block_") +
303  std::to_string(static_cast<int>(block->LocalBlockNo)) + "_Round_" +
304  std::to_string(rp.round()) + " Partner " + std::to_string(ingid) +
305  std::string("_Step_2_Contour_Tree_Super_Structure.gv");
306  std::ofstream superStructureFile(superStructureFileName);
307  superStructureFile << worklet::contourtree_distributed::ContourTreeDotGraphPrint < T,
308  MeshType,
309  vtkm::worklet::contourtree_augmented::IdArrayType()(
310  std::string("Block ") + std::to_string(static_cast<int>(block->LocalBlockNo)) +
311  " Round " + std::to_string(rp.round()) + " Partner " + std::to_string(ingid) +
312  std::string(" Step 2 Contour Tree Super Structure"),
313  block->Meshes.back(),
314  block->ContourTrees.back(),
315  worklet::contourtree_distributed::SHOW_SUPER_STRUCTURE |
316  worklet::contourtree_distributed::SHOW_HYPER_STRUCTURE |
317  worklet::contourtree_distributed::SHOW_ALL_IDS |
318  worklet::contourtree_distributed::SHOW_ALL_SUPERIDS |
319  worklet::contourtree_distributed::SHOW_ALL_HYPERIDS);
320  */
321 #endif
322 
323  // Log the contour tree timiing stats
324  (void)rank; // Suppress unused variable warning if logging is disabled.
326  std::endl
327  << " ---------------- Contour Tree Worklet Timings ------------------"
328  << std::endl
329  << " Rank : " << rank << std::endl
330  << " DIY Id : " << selfid << std::endl
331  << " In Id : " << ingid << std::endl
332  << " Round : " << rp.round() << std::endl
333  << worklet.TimingsLogString);
334  // Log the contour tree size stats
335  VTKM_LOG_S(this->TreeLogLevel,
336  std::endl
337  << " ---------------- Contour Tree Array Sizes ---------------------"
338  << std::endl
339  << " Rank : " << rank << std::endl
340  << " DIY Id : " << selfid << std::endl
341  << " In Id : " << ingid << std::endl
342  << " Round : " << rp.round() << std::endl
343  << block->ContourTrees.back().PrintArraySizes());
344 
345  } // end if (ingid != selfid)
346  } // end for
347 
348  // log the time needed to compute the local contour tree
349  timingsStream << " " << std::setw(38) << std::left << "Merge Block (Compute Joint Tree)"
350  << ": " << timer.GetElapsedTime() << " seconds" << std::endl;
351  timer.Start();
352 
353  // If we are not in the first round (contour tree mesh for that round was pre-computed
354  // in filter outside functor) and if we are sending to someone else (i.e., not in
355  // last round) then compute contour tree mesh to send and save it.
356  if (rp.round() != 0 && rp.out_link().size() != 0)
357  {
358  vtkm::Id3 maxIdx{ block->BlockOrigin[0] + block->BlockSize[0] - 1,
359  block->BlockOrigin[1] + block->BlockSize[1] - 1,
360  block->BlockOrigin[2] + block->BlockSize[2] - 1 };
361 
362  // Compute BRACT
364  // ... Get the mesh boundary object
365  auto meshBoundaryExecObj = block->ContourTreeMeshes.back().GetMeshBoundaryExecutionObject(
366  this->GlobalSize, block->BlockOrigin, maxIdx);
367  // Make the BRACT and InteriorForest (i.e., residue)
368  block->InteriorForests.emplace_back();
372  &(block->ContourTreeMeshes.back()),
373  meshBoundaryExecObj,
374  block->ContourTrees.back(),
375  &boundaryTree,
376  &(block->InteriorForests.back()));
377  // Construct the BRACT and InteriorForest. Since we are working on a ContourTreeMesh we do
378  // not need to provide and IdRelabeler here in order to compute the InteriorForest
379  boundaryTreeMaker.Construct(nullptr, this->UseBoundaryExtremaOnly);
380  // Construct contour tree mesh from BRACT
381  block->ContourTreeMeshes.emplace_back(
382  boundaryTree.VertexIndex, boundaryTree.Superarcs, block->ContourTreeMeshes.back());
383 
384 #ifdef DEBUG_PRINT_CTUD
385  /*
386  // TODO: GET THIS COMPILING.
387  // TODO/FIXME: Need to get inggid here somehow
388  // save the Boundary Tree as a dot file
389  std::string boundaryTreeFileName = std::string("Rank_") +
390  std::to_string(static_cast<int>(rank)) + std::string("_Block_") +
391  std::to_string(static_cast<int>(block->LocalBlockNo)) + "_Round_" +
392  std::to_string(rp.round()) + "_Partner_" + std::to_string(ingid) +
393  std::string("_Step_3_Boundary_Tree.gv");
394  std::ofstream boundaryTreeFile(boundaryTreeFileName);
395  boundaryTreeFile << vtkm::worklet::contourtree_distributed::BoundaryTreeDotGraphPrint
396  (std::string("Block ") + std::to_string(static_cast<int>(block->LocalBlockNo)) + " Round " +
397  std::to_string(rp.round()) + " Partner " + std::to_string(ingid) +
398  std::string(" Step 3 Boundary Tree"),
399  block->Meshes.back()],
400  block->BoundaryTrees.back());
401 
402  // and save the Interior Forest as another dot file
403  std::string interiorForestFileName = std::string("Rank_") +
404  std::to_string(static_cast<int>(rank)) + std::string("_Block_") +
405  std::to_string(static_cast<int>(block->LocalBlockNo)) + "_Round_" +
406  std::to_string(rp.round()) + "_Partner_" + std::to_string(ingid) +
407  std::string("_Step_4_Interior_Forest.gv");
408  std::ofstream interiorForestFile(interiorForestFileName);
409  interiorForestFileName << InteriorForestDotGraphPrintFile<MeshType>(
410  std::string("Block ") + std::to_string(static_cast<int>(block->LocalBlockNo)) + " Round " +
411  std::to_string(rp.round()) + " Partner " + std::to_string(ingid) +
412  std::string(" Step 4 Interior Forest"),
413  block->InteriorForests.back(),
414  block->ContourTrees.back(),
415  block->BoundaryTrees.back(),
416  block->Meshes.back());
417 
418  // save the corresponding .gv file
419  std::string boundaryTreeMeshFileName = std::string("Rank_") +
420  std::to_string(static_cast<int>(rank)) + std::string("_Block_") +
421  std::to_string(static_cast<int>(block->LocalBlockNo)) + "_Round_" +
422  std::to_string(rp.round()) + "_Partner_" + std::to_string(ingid) +
423  std::string("_Step_5_Boundary_Tree_Mesh.gv");
424  std::ofstream boundaryTreeMeshFile(boundaryTreeMeshFileName);
425  boundaryTreeMeshFile
426  << vtkm::worklet::contourtree_distributed::ContourTreeMeshDotGraphPrint<FieldType>(
427  std::string("Block ") + std::to_string(static_cast<int>(block->LocalBlockNo)) +
428  " Round " + std::to_string(rp.round()) + " Partner " + std::to_string(ingid) +
429  std::string(" Step 5 Boundary Tree Mesh"),
430  block->ContourTreeMeshes.back(),
431  worklet::contourtree_distributed::SHOW_CONTOUR_TREE_MESH_ALL);
432  */
433 #endif
434 
435  // Log the boundary tree size statistics
436  VTKM_LOG_S(this->TreeLogLevel,
437  std::endl
438  << " ---------------- Boundary Tree Array Sizes ---------------------"
439  << std::endl
440  << " Rank : " << rank << std::endl
441  << " DIY Id : " << selfid << std::endl
442  << " Round : " << rp.round() << std::endl
443  << boundaryTree.PrintArraySizes());
444  // Log the interior forest statistics
445  VTKM_LOG_S(this->TreeLogLevel,
446  std::endl
447  << " ---------------- Interior Forest Array Sizes ---------------------"
448  << std::endl
449  << " Rank : " << rank << std::endl
450  << " DIY Id : " << selfid << std::endl
451  << " Round : " << rp.round() << std::endl
452  << block->InteriorForests.back().PrintArraySizes());
453  } // end if (rp.round() != 0 && rp.out_link().size() != 0)
454 
455  // log the time to compute the boundary tree, interior forest, and contour tree mesh, i.e, the data we need to send
456  timingsStream << " " << std::setw(38) << std::left << "Compute Trees To Send"
457  << ": " << timer.GetElapsedTime() << " seconds" << std::endl;
458  timer.Start();
459 
460 
461  // Send our current block (which is either our original block or the one we just combined from the ones we received) to our next neighbour.
462  // Once a rank has send his block (either in its orignal or merged form) it is done with the reduce
463  for (int cc = 0; cc < rp.out_link().size(); ++cc)
464  {
465  auto target = rp.out_link().target(cc);
466  if (target.gid != selfid)
467  {
468  rp.enqueue(target, block->BlockOrigin);
469  rp.enqueue(target, block->BlockSize);
470  rp.enqueue(target, block->ContourTreeMeshes.back());
471  VTKM_LOG_S(this->TreeLogLevel,
472  std::endl
473  << "FanInEnqueue: Rank=" << rank << "; Round=" << rp.round()
474  << "; DIY Send Id=" << selfid << "; DIY Target ID=" << target.gid
475  << std::endl);
476  }
477  } // end for
478 
479  // Log the time for enqueue the data for sending via DIY
480  timingsStream << " " << std::setw(38) << std::left << "DIY Enqueue Data"
481  << ": " << timer.GetElapsedTime() << " seconds" << std::endl;
482  // Log the total this functor call step took
483  timingsStream << " " << std::setw(38) << std::left << "Total Time Functor Step"
484  << ": " << totalTimer.GetElapsedTime() << " seconds" << std::endl;
485  // Record the times we logged
487  std::endl
488  << " ---------------- Fan In Functor Step ---------------------" << std::endl
489  << " Rank : " << rank << std::endl
490  << " DIY Id : " << selfid << std::endl
491  << " Round : " << rp.round() << std::endl
492  << timingsStream.str());
493 
494  } //end ComputeDistributedContourTreeFunctor
495 
496 
497 private:
500 
503 
506 
509 };
510 
511 
512 } // namespace contourtree_distributed
513 } // namespace worklet
514 } // namespace vtkm
515 
516 #endif
vtkm::cont::ArrayHandle< vtkm::Id >
vtkm::cont::EnvironmentTracker::GetCommunicator
static const VTKM_CONT vtkmdiy::mpi::communicator & GetCommunicator()
vtkm::worklet::ContourTreeAugmented::TimingsLogString
std::string TimingsLogString
Remember the results from our time-keeping so we can customize our logging.
Definition: worklet/ContourTreeUniformAugmented.h:100
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
Types.h
vtkm::worklet::contourtree_distributed::ComputeDistributedContourTreeFunctor::UseBoundaryExtremaOnly
bool UseBoundaryExtremaOnly
Use boundary extrema only (instead of the full boundary) during the fan in.
Definition: ComputeDistributedContourTreeFunctor.h:502
vtkm::worklet::contourtree_distributed::DistributedContourTreeBlockData::ContourTrees
std::vector< vtkm::worklet::contourtree_augmented::ContourTree > ContourTrees
Definition: DistributedContourTreeBlockData.h:85
vtkm::cont::Timer::Start
VTKM_CONT void Start()
vtkm::worklet::contourtree_distributed::DistributedContourTreeBlockData
Definition: DistributedContourTreeBlockData.h:76
vtkm::worklet::contourtree_distributed::DistributedContourTreeBlockData::InteriorForests
std::vector< vtkm::worklet::contourtree_distributed::InteriorForest > InteriorForests
Definition: DistributedContourTreeBlockData.h:87
vtkm::cont::LogLevel
LogLevel
Log levels for use with the logging macros.
Definition: Logging.h:298
vtkm::worklet::contourtree_distributed::DistributedContourTreeBlockData::ContourTreeMeshes
std::vector< vtkm::worklet::contourtree_augmented::ContourTreeMesh< FieldType > > ContourTreeMeshes
Definition: DistributedContourTreeBlockData.h:86
vtkm::worklet::contourtree_augmented::ContourTreeMesh
Definition: ContourTreeMesh.h:129
vtkm::worklet::contourtree_distributed::ComputeDistributedContourTreeFunctor::GlobalSize
vtkm::Id3 GlobalSize
Extends of the global mesh.
Definition: ComputeDistributedContourTreeFunctor.h:499
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
vtkm::worklet::contourtree_distributed::BoundaryTree::VertexIndex
vtkm::worklet::contourtree_augmented::IdArrayType VertexIndex
Definition: BoundaryTree.h:85
vtkm::cont::LogLevel::Info
@ Info
Information messages (detected hardware, etc) and temporary debugging output.
vtkm::cont::ErrorInternal
This class is thrown when VTKm detects an internal state that should never be reached.
Definition: ErrorInternal.h:26
vtkm::worklet::ContourTreeAugmented::TimingsLogLevel
vtkm::cont::LogLevel TimingsLogLevel
Definition: worklet/ContourTreeUniformAugmented.h:97
DistributedContourTreeBlockData.h
vtkm::worklet::contourtree_distributed::DistributedContourTreeBlockData::LocalBlockNo
vtkm::Id LocalBlockNo
Definition: DistributedContourTreeBlockData.h:80
vtkm::worklet::contourtree_distributed::ComputeDistributedContourTreeFunctor::operator()
void operator()(vtkm::worklet::contourtree_distributed::DistributedContourTreeBlockData< FieldType > *block, const vtkmdiy::ReduceProxy &rp, const vtkmdiy::RegularSwapPartners &) const
Operator used by DIY to compute a step in the fan in.
Definition: ComputeDistributedContourTreeFunctor.h:104
Error.h
vtkm::worklet::contourtree_distributed::ComputeDistributedContourTreeFunctor::TreeLogLevel
vtkm::cont::LogLevel TreeLogLevel
Log level to be used for outputting metadata about the trees. Default is vtkm::cont::LogLevel::Info.
Definition: ComputeDistributedContourTreeFunctor.h:508
vtkm::worklet::contourtree_distributed::ComputeDistributedContourTreeFunctor::TimingsLogLevel
vtkm::cont::LogLevel TimingsLogLevel
Log level to be used for outputting timing information. Default is vtkm::cont::LogLevel::Perf.
Definition: ComputeDistributedContourTreeFunctor.h:505
vtkm::worklet::contourtree_distributed::DistributedContourTreeBlockData::BlockOrigin
vtkm::Id3 BlockOrigin
Definition: DistributedContourTreeBlockData.h:81
Types.h
vtkm::cont::Timer
A class that can be used to time operations in VTK-m that might be occuring in parallel.
Definition: Timer.h:43
vtkm::worklet::ContourTreeAugmented
Compute the contour tree for 2d and 3d uniform grids and arbitrary topology graphs.
Definition: worklet/ContourTreeUniformAugmented.h:89
PrintGraph.h
vtkm::worklet::contourtree_distributed::BoundaryTree::PrintArraySizes
std::string PrintArraySizes() const
Definition: BoundaryTree.h:308
vtkm::cont::Error::what
const char * what() const noexcept override
Definition: Error.h:51
vtkm::worklet::contourtree_distributed::DistributedContourTreeBlockData::BlockSize
vtkm::Id3 BlockSize
Definition: DistributedContourTreeBlockData.h:82
VTKM_LOG_S
#define VTKM_LOG_S(level,...)
Writes a message using stream syntax to the indicated log level.
Definition: Logging.h:261
vtkm::worklet::contourtree_distributed::ComputeDistributedContourTreeFunctor::ComputeDistributedContourTreeFunctor
ComputeDistributedContourTreeFunctor(vtkm::Id3 globalSize, bool useBoundaryExtremaOnly, vtkm::cont::LogLevel timingsLogLevel=vtkm::cont::LogLevel::Perf, vtkm::cont::LogLevel treeLogLevel=vtkm::cont::LogLevel::Info)
Create the functor.
Definition: ComputeDistributedContourTreeFunctor.h:88
vtkm::Vec< vtkm::Id, 3 >
vtkm::worklet::contourtree_distributed::BoundaryTree
Boundary Restricted Augmented Contour Tree (BRACT)
Definition: BoundaryTree.h:81
vtkm::cont::LogLevel::Off
@ Off
Used with SetStderrLogLevel to silence the log.
vtkm::worklet::contourtree_distributed::BoundaryTreeMaker
Class to compute the Boundary Restricted Augmented Contour Tree (BRACT), a.k.a., BoundaryTree.
Definition: BoundaryTreeMaker.h:116
vtkm::worklet::contourtree_distributed::SHOW_CONTOUR_TREE_MESH_ALL
constexpr vtkm::Id SHOW_CONTOUR_TREE_MESH_ALL
Definition: PrintGraph.h:210
vtkm::worklet::ContourTreeAugmented::Run
void Run(const vtkm::cont::ArrayHandle< FieldType, StorageType > fieldArray, MeshType &mesh, contourtree_augmented::ContourTree &contourTree, contourtree_augmented::IdArrayType &sortOrder, vtkm::Id &nIterations, unsigned int computeRegularStructure, const MeshBoundaryMeshExecType &meshBoundary)
Definition: worklet/ContourTreeUniformAugmented.h:127
vtkm::worklet::contourtree_distributed::ComputeDistributedContourTreeFunctor
Functor used by DIY reduce the merge data blocks in parallel.
Definition: ComputeDistributedContourTreeFunctor.h:79
vtkm::worklet::contourtree_distributed::BoundaryTree::Superarcs
vtkm::worklet::contourtree_augmented::IdArrayType Superarcs
Definition: BoundaryTree.h:88
vtkm::worklet::contourtree_augmented::MeshBoundaryContourTreeMeshExec
Definition: MeshBoundaryContourTreeMesh.h:133
vtkm::cont::Timer::GetElapsedTime
VTKM_CONT vtkm::Float64 GetElapsedTime() const
Get the elapsed time measured by the given device adapter.
ContourTreeUniformAugmented.h
vtkm::cont::LogLevel::Perf
@ Perf
General timing data and algorithm flow information, such as filter execution, worklet dispatches,...