diff --git a/lib/linalg/Vector.cpp b/lib/linalg/Vector.cpp index f2cf07966..9771ecaef 100644 --- a/lib/linalg/Vector.cpp +++ b/lib/linalg/Vector.cpp @@ -585,10 +585,11 @@ double Vector::localMin(int nmax) } void -Vector::distribute(const int &local_dim) +Vector::distribute(const int local_dim) { CAROM_VERIFY(!distributed()); CAROM_VERIFY(d_owns_data); + CAROM_VERIFY(local_dim > 0); std::vector row_offsets; int global_dim = get_global_offsets(local_dim, row_offsets, diff --git a/lib/linalg/Vector.h b/lib/linalg/Vector.h index 780229457..40405fb1b 100644 --- a/lib/linalg/Vector.h +++ b/lib/linalg/Vector.h @@ -768,12 +768,14 @@ class Vector * @pre d_owns_data * * @param[in] local_dim dimension for local MPI rank. + * Its sum over all processes should be the same as the current dimension. */ - void distribute(const int &local_dim); + void distribute(const int local_dim); /** * @brief Gather all the distributed elements among MPI processes. * This becomes not distributed after this function is executed. + * The data is identical on all processes after the operation. * * @pre distributed() * @pre d_owns_data