scotchDecomp Class Reference

Scotch domain decomposition. When run in parallel will collect the whole graph on to the master, decompose and send back. Use ptscotchDecomp for proper distributed decomposition. More...

Inheritance diagram for scotchDecomp:
Collaboration diagram for scotchDecomp:

Public Member Functions

 TypeName ("scotch")
 Runtime type information. More...
 
 scotchDecomp (const dictionary &decompositionDict)
 Construct given the decomposition dictionary and mesh. More...
 
 scotchDecomp (const scotchDecomp &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~scotchDecomp ()
 Destructor. More...
 
virtual bool parallelAware () const
 Is method parallel aware (i.e. does it synchronize domains across. More...
 
virtual labelList decompose (const polyMesh &mesh, const pointField &points, const scalarField &pointWeights)
 Return for every coordinate the wanted processor number. Use the. More...
 
virtual labelList decompose (const polyMesh &mesh, const labelList &agglom, const pointField &regionPoints, const scalarField &regionWeights)
 Return for every coordinate the wanted processor number. Gets. More...
 
virtual labelList decompose (const labelListList &globalCellCells, const pointField &cc, const scalarField &cWeights)
 Return for every coordinate the wanted processor number. Explicitly. More...
 
void operator= (const scotchDecomp &)=delete
 Disallow default bitwise assignment. More...
 
- Public Member Functions inherited from decompositionMethod
 TypeName ("decompositionMethod")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, decompositionMethod, dictionary,(const dictionary &decompositionDict),(decompositionDict))
 
 decompositionMethod (const dictionary &decompositionDict)
 Construct given the decomposition dictionary. More...
 
 decompositionMethod (const decompositionMethod &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~decompositionMethod ()
 Destructor. More...
 
label nDomains () const
 
virtual labelList decompose (const pointField &points, const scalarField &pointWeights)
 Return for every coordinate the wanted processor number. More...
 
virtual labelList decompose (const pointField &)
 Like decompose but with uniform weights on the points. More...
 
virtual labelList decompose (const polyMesh &, const pointField &)
 Like decompose but with uniform weights on the points. More...
 
virtual labelList decompose (const polyMesh &mesh, const labelList &cellToRegion, const pointField &regionPoints)
 Like decompose but with uniform weights on the regions. More...
 
virtual labelList decompose (const labelListList &globalCellCells, const pointField &cc)
 Like decompose but with uniform weights on the cells. More...
 
void setConstraints (const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections)
 Helper: extract constraints: More...
 
void applyConstraints (const polyMesh &mesh, const boolList &blockedFace, const PtrList< labelList > &specifiedProcessorFaces, const labelList &specifiedProcessor, const List< labelPair > &explicitConnections, labelList &finalDecomp)
 Helper: apply constraints to a decomposition. This gives. More...
 
virtual labelList decompose (const polyMesh &mesh, const scalarField &cellWeights, const boolList &blockedFace, const PtrList< labelList > &specifiedProcessorFaces, const labelList &specifiedProcessor, const List< labelPair > &explicitConnections)
 
labelList decompose (const polyMesh &mesh, const scalarField &cWeights)
 Decompose a mesh. Apply all constraints from decomposeParDict. More...
 
void operator= (const decompositionMethod &)=delete
 Disallow default bitwise assignment. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from decompositionMethod
static autoPtr< decompositionMethodNew (const dictionary &decompositionDict)
 Return a reference to the selected decomposition method. More...
 
static void calcCellCells (const polyMesh &mesh, const labelList &agglom, const label nLocalCoarse, const bool global, CompactListList< label > &cellCells)
 Helper: determine (local or global) cellCells from mesh. More...
 
static void calcCellCells (const polyMesh &mesh, const labelList &agglom, const label nLocalCoarse, const bool parallel, CompactListList< label > &cellCells, CompactListList< scalar > &cellCellWeights)
 Helper: determine (local or global) cellCells and face weights. More...
 
- Protected Attributes inherited from decompositionMethod
const dictionarydecompositionDict_
 
label nProcessors_
 
PtrList< decompositionConstraintconstraints_
 Optional constraints. More...
 

Detailed Description

Scotch domain decomposition. When run in parallel will collect the whole graph on to the master, decompose and send back. Use ptscotchDecomp for proper distributed decomposition.

Quoting from the Scotch forum, on the 2008-08-22 10:09, Francois PELLEGRINI posted the following details:

RE: Graph mapping 'strategy' string

Strategy handling in Scotch is a bit tricky. In order
not to be confused, you must have a clear view of how they are built.
Here are some rules:

1- Strategies are made up of "methods" which are combined by means of
"operators".

2- A method is of the form "m{param=value,param=value,...}", where "m"
is a single character (this is your first error: "f" is a method name,
not a parameter name).

3- There exist different sort of strategies : bipartitioning strategies,
mapping strategies, ordering strategies, which cannot be mixed. For
instance, you cannot build a bipartitioning strategy and feed it to a
mapping method (this is your second error).

To use the "mapCompute" routine, you must create a mapping strategy, not
a bipartitioning one, and so use stratGraphMap() and not
stratGraphBipart(). Your mapping strategy should however be based on the
"recursive bipartitioning" method ("b"). For instance, a simple (and
hence not very efficient) mapping strategy can be :

"b{sep=f}"

which computes mappings with the recursive bipartitioning method "b",
this latter using the Fiduccia-Mattheyses method "f" to compute its
separators.

If you want an exact partition (see your previous post), try
"b{sep=fx}".

However, these strategies are not the most efficient, as they do not
make use of the multi-level framework.

To use the multi-level framework, try for instance:

"b{sep=m{vert=100,low=h,asc=f}x}"

The current default mapping strategy in Scotch can be seen by using the
"-vs" option of program gmap. It is, to date:

r
{
    job=t,
    map=t,
    poli=S,
    sep=
    (
        m
        {
            asc=b
            {
                bnd=
                (
                    d{pass=40,dif=1,rem=1}
                 |
                )
                f{move=80,pass=-1,bal=0.002491},
                org=f{move=80,pass=-1,bal=0.002491},
                width=3
            },
            low=h{pass=10}
            f{move=80,pass=-1,bal=0.002491},
            type=h,
            vert=80,
            rat=0.8
        }
      | m
        {
            asc=b
            {
                bnd=
                (
                    d{pass=40,dif=1,rem=1}
                  |
                )
                f{move=80,pass=-1,bal=0.002491},
                org=f{move=80,pass=-1,bal=0.002491},
                width=3
            },
            low=h{pass=10}
            f{move=80,pass=-1,bal=0.002491},
            type=h,
            vert=80,
            rat=0.8
        }
    )
}

Given that this information was written in 2008, this example strategy will unlikely work as-is with the more recent Scotch versions. Therefore, the steps for getting the current default strategy from within Scotch, is to do the following steps:

  1. Edit the file system/decomposeParDict and use the following settings:

    method          scotch;
    
    scotchCoeffs
    {
        writeGraph true;
    }
    

  2. Run decomposePar. For example, it will write a file named region0.grf.

  3. Now, instead of using gmap, run gpart with the following command structure to get the default strategy:

    gpart \<nProcs\> -vs \<grfFile\>
    

    where:

    • <grfFile> is the file that was obtained with the option writeGraph=true, namely region0.grf.
    • <nProcs> is the numberOfSubdomains defined in the dictionary file.

  4. At the end of the execution will be shown a long string, similar to the following example (complete line was cropped at [...]):

    S    Strat=m{asc=b{width=3,bnd=d{pass=40,dif=1,rem=0}[...],type=h}
    

  5. Edit the file system/decomposeParDict once again and add the strategy entry as exemplified:

    method          scotch;
    
    scotchCoeffs
    {
        // writeGraph true;
        strategy "m{asc=b{width=3,bnd=d{pass=40,dif=1,rem=0}[...],type=h}";
    }
    

  6. Finally, run decomposePar once again, to at least test if it works as intended.

Note
gpart can be found in the current search path by adding the respective bin folder from the Scotch installation, namely by running the following commands:
source $(foamEtcFile config.sh/scotch)
export PATH=$PATH:$SCOTCH_ARCH_PATH/bin
Source files

Definition at line 224 of file scotchDecomp.H.

Constructor & Destructor Documentation

◆ scotchDecomp() [1/2]

scotchDecomp ( const dictionary decompositionDict)

Construct given the decomposition dictionary and mesh.

Definition at line 80 of file dummyScotchDecomp.C.

◆ scotchDecomp() [2/2]

scotchDecomp ( const scotchDecomp )
delete

Disallow default bitwise copy construction.

◆ ~scotchDecomp()

virtual ~scotchDecomp ( )
inlinevirtual

Destructor.

Definition at line 269 of file scotchDecomp.H.

Member Function Documentation

◆ TypeName()

TypeName ( "scotch"  )

Runtime type information.

◆ parallelAware()

virtual bool parallelAware ( ) const
inlinevirtual

Is method parallel aware (i.e. does it synchronize domains across.

proc boundaries)

Implements decompositionMethod.

Definition at line 275 of file scotchDecomp.H.

References decompositionMethod::decompose(), mesh, scotchDecomp::operator=(), and points.

Here is the call graph for this function:

◆ decompose() [1/3]

Foam::labelList decompose ( const polyMesh mesh,
const pointField points,
const scalarField pointWeights 
)
virtual

Return for every coordinate the wanted processor number. Use the.

mesh connectivity (if needed) Weights get normalised with minimum weight and truncated to convert into integer so e.g. 3.5 is seen as 3. The overall sum of weights might otherwise overflow.

Implements decompositionMethod.

Definition at line 91 of file dummyScotchDecomp.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, notImplementedMessage, and List< label >::null().

Here is the call graph for this function:

◆ decompose() [2/3]

Foam::labelList decompose ( const polyMesh mesh,
const labelList agglom,
const pointField regionPoints,
const scalarField regionWeights 
)
virtual

Return for every coordinate the wanted processor number. Gets.

passed agglomeration map (from fine to coarse cells) and coarse cell location. Can be overridden by decomposers that provide this functionality natively. See note on weights above.

Reimplemented from decompositionMethod.

Definition at line 105 of file dummyScotchDecomp.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, notImplementedMessage, and List< label >::null().

Here is the call graph for this function:

◆ decompose() [3/3]

Foam::labelList decompose ( const labelListList globalCellCells,
const pointField cc,
const scalarField cWeights 
)
virtual

Return for every coordinate the wanted processor number. Explicitly.

provided mesh connectivity. The connectivity is equal to mesh.cellCells() except for

  • in parallel the cell numbers are global cell numbers (starting from 0 at processor0 and then incrementing all through the processors)
  • the connections are across coupled patches See note on weights above.

Implements decompositionMethod.

Definition at line 120 of file dummyScotchDecomp.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, notImplementedMessage, and List< label >::null().

Here is the call graph for this function:

◆ operator=()

void operator= ( const scotchDecomp )
delete

Disallow default bitwise assignment.

Referenced by scotchDecomp::parallelAware().

Here is the caller graph for this function:

The documentation for this class was generated from the following files: