From e08e23aff4e14e87fb5387855d5df675bb708f96 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 14 Feb 2019 12:40:25 +0000 Subject: [PATCH] ENH: scotchDecomp: check validity of processorWeights. Fixes #1207. --- src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C | 9 +++++++++ src/parallel/decompose/scotchDecomp/scotchDecomp.C | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C index c5f652bab4..3090f25e1a 100644 --- a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C +++ b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C @@ -718,6 +718,15 @@ Foam::label Foam::ptscotchDecomp::decompose << processorWeights << endl; } + + if (processorWeights.size() != nDomains_) + { + FatalIOErrorInFunction(coeffsDict_) + << "processorWeights not the same size" + << " as the wanted number of domains " << nDomains_ + << exit(FatalIOError); + } + check ( SCOTCH_archCmpltw diff --git a/src/parallel/decompose/scotchDecomp/scotchDecomp.C b/src/parallel/decompose/scotchDecomp/scotchDecomp.C index 348745e786..38667ebf36 100644 --- a/src/parallel/decompose/scotchDecomp/scotchDecomp.C +++ b/src/parallel/decompose/scotchDecomp/scotchDecomp.C @@ -349,6 +349,14 @@ Foam::label Foam::scotchDecomp::decomposeSerial Info<< "scotchDecomp : Using procesor weights " << processorWeights << endl; } + if (processorWeights.size() != nDomains_) + { + FatalIOErrorInFunction(coeffsDict_) + << "processorWeights not the same size" + << " as the wanted number of domains " << nDomains_ + << exit(FatalIOError); + } + check ( SCOTCH_archCmpltw