Skip to content
Snippets Groups Projects
Verified Commit 3240de21 authored by raphael.bach's avatar raphael.bach
Browse files

Fix offset computation in `fmpi_partition_block_1d()`

parent c98c0b9f
No related branches found
No related tags found
No related merge requests found
......@@ -93,7 +93,7 @@ static struct fmpi_data fmpi_partition_block_1d(
const size_t rem = data->cnt % (size_t)ctx->mpi->size;
const size_t cnt = (rank < rem) ? (cnt_per_proc + 1) : cnt_per_proc;
const size_t size = cnt * data->type.size;
const size_t offset = (rank * size) + rem;
const size_t offset = (rank * size) + (rank < rem ? 0 : rem);
return (struct fmpi_data){
.type = data->type,
.cnt = cnt,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment