Skip to content
Snippets Groups Projects
Commit 2e828b94 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Fix loop-carried dependency.

parent d8b70ab6
No related branches found
No related tags found
No related merge requests found
......@@ -243,9 +243,12 @@ modelRun(struct model_config setup, MPI_Comm comm)
chunks, 1, MPI_INT, 0, comm));
if (rank == 0)
{
displs[0] = 0;
for (size_t i = 1; i < (size_t)comm_size; ++i)
displs[i] = displs[i - 1] + chunks[i - 1];
int accum = 0;
for (size_t i = 0; i < (size_t)comm_size; ++i)
{
displs[i] = accum;
accum += chunks[i];
}
}
xmpi(MPI_Gatherv(varslice, chunk, MPI_DOUBLE,
var, chunks, displs, MPI_DOUBLE, 0, comm));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment