| 31 | |
| 32 | template <typename Partition, typename CellStorage> |
| 33 | void printUnreachableStatistics(const Partition &partition, |
| 34 | const CellStorage &storage, |
| 35 | const CellMetric &metric) |
| 36 | { |
| 37 | util::Log() << "Unreachable nodes statistics per level"; |
| 38 | |
| 39 | for (std::size_t level = 1; level < partition.GetNumberOfLevels(); ++level) |
| 40 | { |
| 41 | auto num_cells = partition.GetNumberOfCells(level); |
| 42 | std::size_t invalid_sources = 0; |
| 43 | std::size_t invalid_destinations = 0; |
| 44 | for (std::uint32_t cell_id = 0; cell_id < num_cells; ++cell_id) |
| 45 | { |
| 46 | const auto &cell = storage.GetCell(metric, level, cell_id); |
| 47 | for (auto node : cell.GetSourceNodes()) |
| 48 | { |
| 49 | const auto &weights = cell.GetOutWeight(node); |
| 50 | invalid_sources += |
| 51 | std::all_of(weights.begin(), |
| 52 | weights.end(), |
| 53 | [](auto weight) { return weight == INVALID_EDGE_WEIGHT; }); |
| 54 | } |
| 55 | for (auto node : cell.GetDestinationNodes()) |
| 56 | { |
| 57 | const auto &weights = cell.GetInWeight(node); |
| 58 | invalid_destinations += |
| 59 | std::all_of(weights.begin(), |
| 60 | weights.end(), |
| 61 | [](auto weight) { return weight == INVALID_EDGE_WEIGHT; }); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | if (invalid_sources > 0 || invalid_destinations > 0) |
| 66 | { |
| 67 | util::Log(logWARNING) << "Level " << level << " unreachable boundary nodes per cell: " |
| 68 | << (invalid_sources / (float)num_cells) << " sources, " |
| 69 | << (invalid_destinations / (float)num_cells) << " destinations"; |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | auto LoadAndUpdateEdgeExpandedGraph(const CustomizationConfig &config, |
| 75 | const partitioner::MultiLevelPartition &mlp, |
no test coverage detected