ddm.partition#
Functions#
|
With the aim of distributing a multi-dimensional array on a Cartesian topology, compute the number of processes along each dimension. |
|
|
|
|
|
Compute the number of processes in each patch and assign to it an ascending range of processes. |
Details#
- compute_dims(nnodes, gridsizes, min_blocksizes=None, mpi=None, try_uniform=False, mpi_dims_mask=None)[source]#
With the aim of distributing a multi-dimensional array on a Cartesian topology, compute the number of processes along each dimension.
Whenever possible, the number of processes is chosen so that the array is decomposed into identical blocks.
- Parameters:
- nnodesint
Number of processes in the Cartesian topology.
- gridsizeslist of int
Number of array elements along each dimension.
- min_blocksizeslist of int
Minimum acceptable size of a block along each dimension.
- try_uniform: bool
try to decompose the array uniformly.
- mpi_dims_mask: list of bool
True if the dimension is to be used in the domain decomposition (=default for each dimension). If dim_mask[i]=False, the domain decomposition yields blocksizes[i]=gridsizes[i] along the i-th dimension.
- Returns:
- dimslist of int
Number of processes along each dimension of the Cartesian topology.
- blocksizeslist of int
Nominal block size along each dimension.
- partition_procs_per_patch(npts, size)[source]#
Compute the number of processes in each patch and assign to it an ascending range of processes. The processes are distributed porportionally to the patch grid size.
- Parameters:
- nptslist
Number of points along each dimension for each patch.
- sizeint
Number of processes.
- Returns:
- sizeslist of int
Number of processes in each patch.
- ranges: list of list of int
The assigned ascending range of processes for each patch, the range is represented by a list of ints of size 2 [k1,k2], such that k1<=k2.