AssertThrow(false, ExcMETISNotInstalled());
#else
- // generate the data structures for
- // METIS. Note that this is particularly
- // simple, since METIS wants exactly our
- // compressed row storage format. we only
- // have to set up a few auxiliary arrays
- idx_t n = static_cast<signed int>(sparsity_pattern.n_rows()),
- ncon = 1, // number of balancing constraints (should be >0)
- nparts =
- static_cast<int>(n_partitions), // number of subdomains to create
- dummy; // the numbers of edges cut by the
- // resulting partition
+ // Generate the data structures for METIS. Note that this is particularly
+ // simple, since METIS wants exactly our compressed row storage format.
+ // We only have to set up a few auxiliary arrays and convert from our
+ // unsigned cell weights to signed ones.
+ idx_t n = static_cast<signed int>(sparsity_pattern.n_rows());
+
+ idx_t ncon = 1; // number of balancing constraints (should be >0)
// We can not partition n items into more than n parts. METIS will
// generate non-sensical output (everything is owned by a single process)
// and complain with a message (but won't return an error code!):
// ***Cannot bisect a graph with 0 vertices!
// ***You are trying to partition a graph into too many parts!
- nparts = std::min(n, nparts);
+ idx_t nparts =
+ std::min(n,
+ static_cast<idx_t>(
+ n_partitions)); // number of subdomains to create
// use default options for METIS
idx_t options[METIS_NOPTIONS];
std::vector<idx_t> int_partition_indices(sparsity_pattern.n_rows());
- // Setup cell weighting option
+ // Set up cell weighting option
std::vector<idx_t> int_cell_weights;
if (cell_weights.size() > 0)
{
// Select which type of partitioning to create
// Use recursive if the number of partitions is less than or equal to 8
+ idx_t dummy; // output: # of edges cut by the resulting partition
if (nparts <= 8)
ierr = METIS_PartGraphRecursive(&n,
&ncon,