diff --git a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C index c9728768dd..7478de9c9a 100644 --- a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C +++ b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -102,6 +102,14 @@ License } + + Note: writes out .dgr files for debugging. Run with e.g. + + mpirun -np 4 dgpart 2 'processor%r.grf' + + - %r gets replaced by current processor rank + - decompose into 2 domains + \*---------------------------------------------------------------------------*/ #include "ptscotchDecomp.H" @@ -161,6 +169,7 @@ void Foam::ptscotchDecomp::check(const int retVal, const char* str) //- Does prevention of 0 cell domains and calls ptscotch. Foam::label Foam::ptscotchDecomp::decomposeZeroDomains ( + const fileName& meshPath, const List& initadjncy, const List& initxadj, const scalarField& initcWeights, @@ -184,6 +193,7 @@ Foam::label Foam::ptscotchDecomp::decomposeZeroDomains { return decompose ( + meshPath, initadjncy, initxadj, initcWeights, @@ -287,7 +297,7 @@ Foam::label Foam::ptscotchDecomp::decomposeZeroDomains // Do decomposition as normal. Sets finalDecomp. - label result = decompose(adjncy, xadj, cWeights, finalDecomp); + label result = decompose(meshPath, adjncy, xadj, cWeights, finalDecomp); if (debug) @@ -344,6 +354,7 @@ Foam::label Foam::ptscotchDecomp::decomposeZeroDomains // Call scotch with options from dictionary. Foam::label Foam::ptscotchDecomp::decompose ( + const fileName& meshPath, const List& adjncy, const List& xadj, const scalarField& cWeights, @@ -356,58 +367,82 @@ Foam::label Foam::ptscotchDecomp::decompose Pout<< "ptscotchDecomp : entering with xadj:" << xadj.size() << endl; } -// // Dump graph -// if (decompositionDict_.found("ptscotchCoeffs")) -// { -// const dictionary& scotchCoeffs = -// decompositionDict_.subDict("ptscotchCoeffs"); -// -// if (scotchCoeffs.lookupOrDefault("writeGraph", false)) -// { -// OFstream str(mesh_.time().path() / mesh_.name() + ".grf"); -// -// Info<< "Dumping Scotch graph file to " << str.name() << endl -// << "Use this in combination with gpart." << endl; -// -// // Distributed graph file (.grf) -// label version = 2; -// str << version << nl; -// // Number of files -// // Number of files (procglbnbr) -// str << Pstream::nProcs(); -// // My file number (procloc) -// str << ' ' << Pstream::myProcNo() << nl; -// -// // Total number of vertices (vertglbnbr) -// str << returnReduce(mesh.nCells(), sumOp