Commit 19f735d0 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

format.sh applied

parent 1bee0e75
......@@ -325,17 +325,15 @@ void engine_redistribute(struct engine *e) {
for (int p = 0, r = 0; p < nr_nodes; p++) {
for (int s = 0; s < nr_nodes; s++) {
total += counts[r];
if (p == s)
unmoved += counts[r];
if (p == s) unmoved += counts[r];
r++;
}
}
message("of %ld particles %ld are not transferred (%.2f%%)", total, unmoved,
100.0 * (double)unmoved / (double)total);
message("of %ld particles %ld are not transferred (%.2f%%)", total,
unmoved, 100.0 * (double)unmoved / (double)total);
}
}
/* Get all the g_counts from all the nodes. */
if (MPI_Allreduce(MPI_IN_PLACE, g_counts, nr_nodes * nr_nodes, MPI_INT,
MPI_SUM, MPI_COMM_WORLD) != MPI_SUCCESS)
......
......@@ -402,9 +402,9 @@ static void pick_metis(struct space *s, int nregions, int *vertexw, int *edgew,
struct indexval *ivs = malloc(sizeof(struct indexval) * keymax);
bzero(ivs, sizeof(struct indexval) * keymax);
for (int k = 0; k < ncells; k++) {
int index = regionid[k] + nregions * s->cells_top[k].nodeID;
ivs[index].count++;
ivs[index].index = index;
int index = regionid[k] + nregions * s->cells_top[k].nodeID;
ivs[index].count++;
ivs[index].index = index;
}
qsort(ivs, keymax, sizeof(struct indexval), indexvalcmp);
......@@ -413,8 +413,8 @@ static void pick_metis(struct space *s, int nregions, int *vertexw, int *edgew,
int *oldmap = malloc(sizeof(int) * nregions);
int *newmap = malloc(sizeof(int) * nregions);
for (int k = 0; k < nregions; k++) {
oldmap[k] = -1;
newmap[k] = -1;
oldmap[k] = -1;
newmap[k] = -1;
}
for (int k = 0; k < keymax; k++) {
......
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