This module is part of Cassiopee, a free open-source pre- and post-processor for CFD simulations.

To use the module with the Converter array interface, you must import it as:

import Distributor2 as D2

To use the module with the pyTree interface, you must import it as:
import Distributor2.PyTree as D2

With the array interface, where A is a list of blocks:

- prescribed is a list of blocks that are forced to be on a given processor. prescribed[2] = 0 means that block 2 MUST be affected to processor 0.

- perfo is a tuple or a tuple list for each processor. Each tuple describes the relative weight of solver CPU time regarding the communication speed and latence (solverWeight, latenceWeight, comSpeedWeight).

- weight is a list of weight for each block indicating the relative cost for solving each block.

- com is a ixj matrix describing the volume of points exchanged between bloc i and bloc j.

Algorithm can be chosen in: 'gradient', 'genetic', 'fast'.

The function output is a stats dictionary. stat['distrib'] is a vector describing the attributed processor for each block, stats['meanPtsPerProc'] is the mean number of points per proc, stats['varMin'] is the minimum variation of number of points, stats['varMax'] is the maximum variation of number of points, stats['varRMS'] is the mean variation of number of points, stats['nptsCom'] is the number of points exchanged between processors for communication, stats['comRatio'] is the ratio of points exchanged between processors in this configuration divided by the total number of points needed in communications, stats['adaptation'] is the value of the optimized function:

stats = D2.distribute(A, NProc, prescribed=[], perfo=[], weight=[], com=[],
algorithm='gradient', nghost=0)

With the pyTree interface, the user-defined node .Solver#Param/proc
is updated with the attributed processor number.If useCom=0, only the grid number of points is taken into account.

If useCom='all', matching and overlap communications are taken into account.

If useCom='match', only match connectivity are taken into account.

if useCom='overlap', only overlap connectivity are taken into account.

if useCom='bbox', overlap between zone bbox is taken into account.

When using distributed trees, prescribed must be a dictionary containing the zones names as key, and the prescribed proc as value. weight is also a dictionary where the keys are the zone names and the weight as the value. It is not mandatory to assign a weight to all the zones of the pyTree. Default value is assumed 1, only different weight values can be assigned to zones. t can be either a skeleton or a loaded skeleton pyTree for useCom=0 or useCom='match', but must be a loaded skeleton tree only for the other settings:

t, stats = D2.distribute(t, NProc, prescribed={}, perfo=[], weight={}, useCom='all', algorithm='gradient')

B = D2.addProcNode(A, 12)

proc = D2.getProc(a) *.or.* [proc1,proc2,...] = D2.getProc(A)

procList = D2.getProcList(A, NProc=None)

A = D2.copyDistribution(A, B)

B = D2.redispatch(A)

Return to main userguide