Commit cc16a063 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

fix formatting in engine.c.


Former-commit-id: 02287ddfeb36f1b0ad1dd4d1c83ebee71ba7a517
parent 34c944e1
......@@ -167,8 +167,8 @@ void engine_redistribute(struct engine *e) {
else if (parts[k].x[j] >= dim[j])
parts[k].x[j] -= dim[j];
}
const int cid = cell_getid(cdim, parts[k].x[0] * ih[0], parts[k].x[1] * ih[1],
parts[k].x[2] * ih[2]);
const int cid = cell_getid(cdim, parts[k].x[0] * ih[0],
parts[k].x[1] * ih[1], parts[k].x[2] * ih[2]);
dest[k] = cells[cid].nodeID;
counts[nodeID * nr_nodes + dest[k]] += 1;
}
......@@ -209,28 +209,28 @@ void engine_redistribute(struct engine *e) {
offset_recv += counts[ind_recv];
} else {
if (MPI_Isend(&s->parts[offset_send],
sizeof(struct part) * counts[ind_send],
MPI_BYTE, k, 2 * ind_send + 0,
MPI_COMM_WORLD, &reqs[4 * k]) != MPI_SUCCESS)
sizeof(struct part) * counts[ind_send], MPI_BYTE, k,
2 * ind_send + 0, MPI_COMM_WORLD,
&reqs[4 * k]) != MPI_SUCCESS)
error("Failed to isend parts to node %i.", k);
if (MPI_Isend(&s->xparts[offset_send],
sizeof(struct xpart) * counts[ind_send],
MPI_BYTE, k, 2 * ind_send + 1,
MPI_COMM_WORLD, &reqs[4 * k + 1]) != MPI_SUCCESS)
sizeof(struct xpart) * counts[ind_send], MPI_BYTE, k,
2 * ind_send + 1, MPI_COMM_WORLD,
&reqs[4 * k + 1]) != MPI_SUCCESS)
error("Failed to isend xparts to node %i.", k);
offset_send += counts[ind_send];
}
}
if (k != nodeID && counts[ind_recv] > 0) {
if (MPI_Irecv(&parts_new[offset_recv],
sizeof(struct part) * counts[ind_recv],
MPI_BYTE, k, 2 * ind_recv + 0,
MPI_COMM_WORLD, &reqs[4 * k + 2]) != MPI_SUCCESS)
sizeof(struct part) * counts[ind_recv], MPI_BYTE, k,
2 * ind_recv + 0, MPI_COMM_WORLD,
&reqs[4 * k + 2]) != MPI_SUCCESS)
error("Failed to emit irecv of parts from node %i.", k);
if (MPI_Irecv(&xparts_new[offset_recv],
sizeof(struct xpart) * counts[ind_recv],
MPI_BYTE, k, 2 * ind_recv + 1,
MPI_COMM_WORLD, &reqs[4 * k + 3]) != MPI_SUCCESS)
sizeof(struct xpart) * counts[ind_recv], MPI_BYTE, k,
2 * ind_recv + 1, MPI_COMM_WORLD,
&reqs[4 * k + 3]) != MPI_SUCCESS)
error("Failed to emit irecv of parts from node %i.", k);
offset_recv += counts[ind_recv];
}
......@@ -955,22 +955,20 @@ int engine_exchange_strays(struct engine *e, int offset, int *ind, int N) {
}
/* Wait for all the sends to have finnished too. */
if ( nr_out > 0 )
if (MPI_Waitall(2 * e->nr_proxies , reqs_out , MPI_STATUSES_IGNORE) !=
MPI_SUCCESS )
if (nr_out > 0)
if (MPI_Waitall(2 * e->nr_proxies, reqs_out, MPI_STATUSES_IGNORE) !=
MPI_SUCCESS)
error("MPI_Waitall on sends failed.");
/* Return the number of harvested parts. */
return count;
#else
error( "SWIFT was not compiled with MPI support." );
error("SWIFT was not compiled with MPI support.");
return 0;
#endif
}
/**
* @brief Fill the #space's task list.
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment