From ed17d3c405f16c5ff1fa945962afd0525fe74b4e Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sun, 26 May 2024 14:27:06 +0100 Subject: [PATCH] parMetis: Added test for points on all processors Unfortunately ParMETIS does not support redistribution of empty processors. --- src/parallel/decompose/parMetis/parMetis.C | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/parallel/decompose/parMetis/parMetis.C b/src/parallel/decompose/parMetis/parMetis.C index b12b0329aa..9fd77d68e0 100644 --- a/src/parallel/decompose/parMetis/parMetis.C +++ b/src/parallel/decompose/parMetis/parMetis.C @@ -308,6 +308,14 @@ Foam::labelList Foam::decompositionMethods::parMetis::decompose << exit(FatalError); } + if (Pstream::parRun() && !points.size()) + { + Pout<< "No points on processor " << Pstream::myProcNo() << nl + << " ParMETIS cannot redistribute without points" + "on all processors." << endl; + FatalErrorInFunction << exit(FatalError); + } + // Make Metis CSR (Compressed Storage Format) storage // adjncy : contains neighbours (= edges in graph) // xadj(celli) : start of information in adjncy for celli @@ -352,6 +360,13 @@ Foam::labelList Foam::decompositionMethods::parMetis::decompose << exit(FatalError); } + if (Pstream::parRun() && !regionPoints.size()) + { + Pout<< "No points on processor " << Pstream::myProcNo() << nl + << " ParMETIS cannot redistribute without points" + "on all processors." << endl; + FatalErrorInFunction << exit(FatalError); + } // Make Metis CSR (Compressed Storage Format) storage // adjncy : contains neighbours (= edges in graph) @@ -405,6 +420,14 @@ Foam::labelList Foam::decompositionMethods::parMetis::decompose << ")." << exit(FatalError); } + if (Pstream::parRun() && !cellCentres.size()) + { + Pout<< "No points on processor " << Pstream::myProcNo() << nl + << " ParMETIS cannot redistribute without points" + "on all processors." << endl; + FatalErrorInFunction << exit(FatalError); + } + // Make Metis Distributed CSR (Compressed Storage Format) storage // adjncy : contains neighbours (= edges in graph) // xadj(celli) : start of information in adjncy for celli