From 482a1b08a7a71251c2ca5ebf243d3c2acae1c329 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 72f79977ec..2845c57c4b 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 e5da307cf7..f0c51a31d0 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