Skip to content

Commit 1c65c6b

Browse files
committed
patchkernel: empty patches don't have an owner
1 parent 412a811 commit 1c65c6b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/patchkernel/patch_kernel_parallel.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,15 @@ int PatchKernel::evalOwner() const
231231
MPI_Allreduce(MPI_IN_PLACE, &nGlobalInternalCells, 1, MPI_LONG, MPI_SUM, getCommunicator());
232232
}
233233

234-
int owner;
235-
if (nInternalCells == nGlobalInternalCells) {
236-
owner = getRank();
237-
} else {
238-
owner = -1;
239-
}
234+
int owner = -1;
235+
if (nGlobalInternalCells > 0) {
236+
if (nInternalCells == nGlobalInternalCells) {
237+
owner = getRank();
238+
}
240239

241-
if (isPartitioned()) {
242-
MPI_Allreduce(MPI_IN_PLACE, &owner, 1, MPI_INT, MPI_MAX, getCommunicator());
240+
if (isPartitioned()) {
241+
MPI_Allreduce(MPI_IN_PLACE, &owner, 1, MPI_INT, MPI_MAX, getCommunicator());
242+
}
243243
}
244244

245245
return owner;

0 commit comments

Comments
 (0)