PISM, A Parallel Ice Sheet Model 2.2.2-d6b3a29ca committed by Constantine Khrulev on 2025-03-28
|
◆ label_components_impl()
template<typename T >
Labels connected components in parallel, using a custom definition of "foreground" and "attached" grid cells. Note that The type Here's the idea:
This method communicates ghosts (once), number of graph edges per sub-domain (once) and then all graph edges (once, only to sub-domains that have at least one patch). Graph traversal is done "redundantly", i.e. each participating sub-domain traverses the whole graph even if it contains one isolated node. This is needed to ensure that resulting labels use consecutive numbers. (Consecutive labels are useful for indexing elsewhere in the code). We /could/ gather graph information on one MPI processor, traverse the graph to compute final labels, then scatter final labels. It is not clear if this would be better, though. The current implementation uses
The alternative implementation would use
TO DO: run benchmarks! Definition at line 95 of file label_components_impl.hh. References pism::details::final_labels(), pism::details::first_label(), pism::array::Array::grid(), and pism::details::relabel(). Referenced by pism::connected_components::label(), and pism::connected_components::label_isolated(). |