From 7fa1e73a35cda24f0526edb7d67934a4355b92ff Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 30 Dec 2010 08:39:40 +0000 Subject: [PATCH] ENH: scotchDecomp : allow decomposition in parallel All of graph gets sent to master which does the decomposition --- .../decompose/scotchDecomp/scotchDecomp.C | 140 +++++++++++++++++- .../decompose/scotchDecomp/scotchDecomp.H | 19 ++- 2 files changed, 151 insertions(+), 8 deletions(-) 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