| 1 |
/* |
| 2 |
* Copyright(C) 2024 National Technology & Engineering Solutions |
| 3 |
* of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 4 |
* NTESS, the U.S. Government retains certain rights in this software. |
| 5 |
* |
| 6 |
* See packages/seacas/LICENSE for details |
| 7 |
*/ |
| 8 |
#pragma once |
| 9 |
|
| 10 |
#include "Ioss_ChainGenerator.h" |
| 11 |
#include "Ioss_CodeTypes.h" |
| 12 |
#include "Ioss_Region.h" |
| 13 |
#include <string> |
| 14 |
#include <vector> |
| 15 |
|
| 16 |
#include "ioss_export.h" |
| 17 |
|
| 18 |
namespace Ioss { |
| 19 |
class IOSS_EXPORT DecompUtils |
| 20 |
{ |
| 21 |
public: |
| 22 |
static void output_histogram(const std::vector<size_t> &proc_work, double avg_work, |
| 23 |
size_t median); |
| 24 |
|
| 25 |
template <typename INT> |
| 26 |
static void line_decomp_modify(const Ioss::chain_t<INT> &element_chains, |
| 27 |
std::vector<int> &element_to_proc, int proc_count); |
| 28 |
|
| 29 |
static std::vector<size_t> get_work_per_rank(const std::vector<int> &elem_to_proc, |
| 30 |
int proc_count); |
| 31 |
static std::pair<double, size_t> |
| 32 |
output_decomposition_statistics(const std::vector<size_t> work_per_rank); |
| 33 |
|
| 34 |
template <typename INT> |
| 35 |
static std::vector<float> line_decomp_weights(const Ioss::chain_t<INT> &element_chains, |
| 36 |
size_t element_count); |
| 37 |
|
| 38 |
template <typename INT> |
| 39 |
static void line_decompose(Region ®ion, size_t num_ranks, const std::string &method, |
| 40 |
const std::string &surface_list, std::vector<int> &element_to_proc, |
| 41 |
INT dummy); |
| 42 |
|
| 43 |
template <typename INT> |
| 44 |
static void decompose_zoltan(const Ioss::Region ®ion, int ranks, const std::string &method, |
| 45 |
std::vector<int> &elem_to_proc, const std::vector<float> &weights, |
| 46 |
bool ignore_x, bool ignore_y, bool ignore_z, |
| 47 |
IOSS_MAYBE_UNUSED INT dummy); |
| 48 |
|
| 49 |
template <typename INT> |
| 50 |
static std::tuple<std::vector<double>, std::vector<double>, std::vector<double>> |
| 51 |
get_element_centroid(const Ioss::Region ®ion, IOSS_MAYBE_UNUSED INT dummy); |
| 52 |
}; |
| 53 |
} // namespace Ioss |