Skip to content
This repository was archived by the owner on Sep 22, 2025. It is now read-only.

Commit aa706f7

Browse files
author
Mikolaj Komar
committed
Fix issues with very small and very big matrices
1 parent 06a6628 commit aa706f7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/dr/mp/containers/broadcasted_slim_matrix.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class broadcasted_slim_matrix {
5151
rng::copy(root_data.begin(), root_data.end(), _data);
5252
}
5353
}
54-
auto position = 0;
55-
auto reminder = sizeof(T) * _data_size;
54+
std::size_t position = 0;
55+
std::size_t reminder = sizeof(T) * _data_size;
5656
while (reminder > INT_MAX) {
5757
comm.bcast(((uint8_t *)_data) + position, INT_MAX, root);
5858
position += INT_MAX;

include/dr/mp/containers/matrix_formats/csr_eq_distribution.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class csr_eq_distribution {
6363
auto real_segment_size =
6464
std::min(nnz_ - rank * segment_size_, segment_size_);
6565
auto local_data = rows_data_;
66-
auto division = real_segment_size / 50;
66+
auto division = std::max(1ul, real_segment_size / 50);
6767
auto one_computation_size = (real_segment_size + division - 1) / division;
6868
auto row_size = row_size_;
6969
dr::__detail::parallel_for_workaround(

0 commit comments

Comments
 (0)