From de1b130a4d36c754c8e67b9e8ca7a3ad5fc34d55 Mon Sep 17 00:00:00 2001 From: Timo Betcke Date: Fri, 4 Oct 2024 12:33:19 +0100 Subject: [PATCH] Fixed doc bugs --- examples/mpi_complete_tree.rs | 6 ++++++ src/tools.rs | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/mpi_complete_tree.rs b/examples/mpi_complete_tree.rs index 3c727ab..bcff3b8 100644 --- a/examples/mpi_complete_tree.rs +++ b/examples/mpi_complete_tree.rs @@ -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)) diff --git a/src/tools.rs b/src/tools.rs index ad4d8b5..dbe8edd 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -347,9 +347,9 @@ pub fn sort_to_bins(sorted_keys: &[T], bins: &[T]) -> Vec { /// /// - 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( sorted_keys: &[T], bins: &[T],