Skip to content
Snippets Groups Projects
Commit acd73d42 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel: Committed by Sergey Kosukhin
Browse files

Fix loop-carried dependency.

parent 7e153dd5
No related branches found
No related tags found
2 merge requests!34Version 2.2.0,!13Consolidation with CDI-PIO (develop)
......@@ -222,8 +222,12 @@ modelRun(struct model_config setup, MPI_Comm comm)
xmpi(MPI_Gather(&chunk, 1, MPI_INT, 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));
#else
......
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