Skip to content

Commit

Permalink
Correcting reserve to resize
Browse files Browse the repository at this point in the history
  • Loading branch information
llaniewski committed Apr 30, 2024
1 parent 7f4f88a commit 33fda1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ArbConnectivity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ inline auto computeInitialNodeDist(size_t num_nodes_global, size_t comm_size) ->
const auto chunk_size = num_nodes_global / comm_size;
const auto div_remainder = num_nodes_global % comm_size;
auto retval = std::vector<long>{};
retval.reserve(comm_size + 1);
retval.push_back(0);
retval.resize(comm_size + 1);
retval[0] = 0;
for (size_t i = 0; i != comm_size; ++i) retval[i+1] = retval[i] + static_cast<long>(chunk_size + (i < div_remainder));
return retval;
}
Expand Down

0 comments on commit 33fda1d

Please sign in to comment.