ENH: additional protection against zero-sized graph offset lists

- for metis-like graphs there is no guarantee that a zero-sized graph
  has an offsets list with size 1 or size 0, so always use

     numCells = max(0, xadj.size()-1)

  this was already done in most places, but missed in the
  decomposeGeneral method

STYLE: use sumOp<label>() instead of plusOp<label>()
This commit is contained in:
Mark Olesen
2022-03-03 21:17:35 +01:00
committed by Andrew Heather
parent e11fde900c
commit 0867816490
6 changed files with 21 additions and 17 deletions

View File

@ -208,8 +208,8 @@ bool setField
doCorrectBoundaryConditions(ctrl.correctBCs, output);
const label numTotal = returnReduce(output.size(), plusOp<label>());
reduce(numValuesChanged, plusOp<label>());
const label numTotal = returnReduce(output.size(), sumOp<label>());
reduce(numValuesChanged, sumOp<label>());
if (numValuesChanged == numTotal)
{