Skip to content

Commit

Permalink
Fixed doc bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
tbetcke committed Oct 4, 2024
1 parent 5edcfb0 commit de1b130
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions examples/mpi_complete_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ pub fn main() {
})
.count();

if comm.size() == 0 {
assert_eq!(nghosts, 0);
} else {
assert!(nghosts > 0);
}

let nglobal = all_keys
.iter()
.filter(|(_, &value)| matches!(value, KeyType::Global))
Expand Down
6 changes: 3 additions & 3 deletions src/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ pub fn sort_to_bins<T: Ord>(sorted_keys: &[T], bins: &[T]) -> Vec<usize> {
///
/// - The array `sorted_keys` is assumed to be sorted within each process. It needs not be globally sorted.
/// - If there are `r` ranks in the communicator, the size of `bins` must be `r`.
/// - The bins are defined through half-open intervals (bin[0], bin[1]), .... This defines r-1 bins. The
/// last bin is the half-open interval [bin[r-1], \infty).
/// - All array elements must be larger or equal bin[0]. This means that each element can be sorted into a bin.
/// - The bins are defined through half-open intervals `(bin[0], bin[1])`, .... This defines r-1 bins. The
/// last bin is the half-open interval `[bin[r-1], \infty)`.
/// - All array elements must be larger or equal `bin[0]`. This means that each element can be sorted into a bin.
pub fn redistribute_by_bins<T: Equivalence + Ord, C: CommunicatorCollectives>(
sorted_keys: &[T],
bins: &[T],
Expand Down

0 comments on commit de1b130

Please sign in to comment.