Overview

The redistributePar utility takes an existing case and redistributes its mesh and fields according to the settings of the <case>/system/decomposeParDict file.

The utility must be run in parallel

Key features:

  • Enables straightforward repartitioning of mesh and fields
  • Can be used to decompose and reconstruct cases in place of decomposePar and reconstructPar, reconstructParMesh
  • Combines reconstructing mesh with reconstructing fields, i.e. no need for reconstructParMesh after parallel mesh generation
  • Runs fully parallel (if supported by the fileHandler)

Constraints:

  • Must be used on the maximum number of processors
  • To run on distributed systems, the utility must be run locally and then the resulting processor directories copied manually to the remote system(s). (24.04.2023 this limitation is under development)

Usage

redistributePar [OPTIONS]

Usage: redistributePar [OPTIONS]
Options:
  -allRegions       Use all regions in regionProperties
  -case <dir>       Case directory (instead of current directory)
  -cellDist         Write cell distribution as a labelList - for use with
                    'manual' decomposition method or as a volScalarField for
                    post-processing.
  -constant         Include the 'constant/' dir in the times list
  -decompose        Decompose case
  -decomposeParDict <file>
                    Alternative decomposePar dictionary file
  -dry-run          Test without writing the decomposition. Changes -cellDist
                    to only write volScalarField.
  -latestTime       Select the latest time
  -newTimes         Only reconstruct new times (i.e. that do not exist already)
  -noZero           Exclude the '0/' dir from the times list, has precedence
                    over the -withZero option
  -overwrite        Overwrite existing mesh/results files
  -parallel         Run in parallel
  -reconstruct      Reconstruct case
  -region <name>    Use specified mesh region. Eg, -region gas
  -regions <wordRes>
                    Use specified mesh region. Eg, -regions gas
                    Or from regionProperties.  Eg, -regions '(gas \"solid.*\")'
  -time <ranges>    List of ranges. Eg, ':10,20 40:70 1000:', 'none', etc
  -verbose          Additional verbosity. (Can be used multiple times)
  -withZero         Include the '0/' dir in the times list
  -doc              Display documentation in browser
  -help             Display short help and exit
  -help-compat      Display compatibility options and exit
  -help-full        Display full help and exit

Redistribute decomposed mesh and fields according to the decomposeParDict
settings.
Optionally run in decompose/reconstruct mode

Using: OpenFOAM-2306 (2306) - visit www.openfoam.com
Build: _fbf00d6b-20230626
Arch:  LSB;label=32;scalar=64


To decompose the case in parallel

mpirun -np 2 redistributePar -decompose -parallel

To reconstruct the case in parallel

mpirun -np 2 redistributePar -reconstruct -parallel

To change the partitioning to a new decomposeParDict, e.g. number of processors or type of partitioning:

Contents of original decomposeParDict:

numberOfSubdomains 6;

method          hierarchical;

coeffs
{
    n           (6 1 1);
}

Contents of new decomposeParDict:

numberOfSubdomains 24;

method        scotch;

Note that the number of subdomains has increased from 6 to 24, and the method changed from hierarchical to scotch. The new settings are applied by executing:

mpirun -np 24 redistributePar -parallel

Further information

Example usage:

  • decomposing using collated output file format:
mpirun -np 2 redistributePar -decompose -fileHandler collated -parallel

Tutorials:

Source code