diff --git a/src/parallel/decompose/scotchDecomp/scotchDecomp.C b/src/parallel/decompose/scotchDecomp/scotchDecomp.C index 1d3f91906d..e22300e057 100644 --- a/src/parallel/decompose/scotchDecomp/scotchDecomp.C +++ b/src/parallel/decompose/scotchDecomp/scotchDecomp.C @@ -108,8 +108,8 @@ License #include "addToRunTimeSelectionTable.H" #include "floatScalar.H" #include "Time.H" -#include "cyclicPolyPatch.H" #include "OFstream.H" +#include "globalIndex.H" extern "C" { @@ -162,7 +162,6 @@ void Foam::scotchDecomp::check(const int retVal, const char* str) } -// Call scotch with options from dictionary. Foam::label Foam::scotchDecomp::decompose ( const fileName& meshPath, @@ -172,6 +171,128 @@ Foam::label Foam::scotchDecomp::decompose List& finalDecomp ) +{ + if (!Pstream::parRun()) + { + decomposeOneProc + ( + meshPath, + adjncy, + xadj, + cWeights, + finalDecomp + ); + } + else + { + if (debug) + { + Info<< "scotchDecomp : running in parallel." + << " Decomposing all of graph on master processor." << endl; + } + globalIndex globalCells(xadj.size()-1); + label nTotalConnections = returnReduce(adjncy.size(), sumOp