Module fd4_part_rcb_mod


Uses:
    module fd4_globaldef_mod
    module fd4_domain_mod
    module fd4_iter_mod
    module fd4_mpi_mod
    module rbtree_fd4_block_mod
Subroutines and functions:
    public subroutine fd4_part_rcb_weight (domain, all_blocks, all_blocks_len, local_blocks, local_blocks_len, balance, err)
    private recursive subroutine fd4_part_rcb_bisect (domain, bnd, ranks)
    private subroutine fd4_part_rcb_exch_weights (domain, all_blocks, all_blocks_len, err)

Recursive Coordinate Bisection partitioning of an fd4_domain.

CAUTION: Don't use! Has not been tested for large domains or high process counts.

Author: Matthias Lieber

See also: module fd4_domain_mod


Description of Subroutines and Functions

fd4_part_rcb_weight

public subroutine fd4_part_rcb_weight (domain, all_blocks, all_blocks_len, local_blocks, local_blocks_len, balance, err)
    type (fd4_domain), intent(inout) :: domain
    integer (kind=i_k), intent(in), dimension (3,all_blocks_len) :: all_blocks
    integer (kind=i_k), intent(in) :: all_blocks_len
    integer (kind=i_k), intent(inout), dimension (:,:) :: local_blocks
    integer (kind=i_k), intent(out) :: local_blocks_len
    real (kind=r4k), intent(out) :: balance
    integer (kind=i_k), intent(out) :: err
end subroutine fd4_part_rcb_weight
Parameters:
domain the domain
all_blocks array of positions of the blocks in the new partion
all_blocks_len length of all_blocks(3,:)
local_blocks array of new local partition (differs from rank to rank)
local_blocks_len length of local_blocks(3,:)
balance estimated balance of new partitioning (not implemented yet)
err error status: 0...ok
Create a new partition using block position. Considers block weights from domain%balance%blkweights.

Only works with processor counts which are powers of 2.

TODO:


fd4_part_rcb_bisect

private recursive subroutine fd4_part_rcb_bisect (domain, bnd, ranks)
    type (fd4_domain), intent(inout) :: domain
    integer (kind=i_k), intent(in), dimension (3,2) :: bnd
    integer (kind=i_k), intent(in), dimension (2) :: ranks
end subroutine fd4_part_rcb_bisect
Parameters:
domain the domain
bnd current subset
ranks rank interval to assign
Recursive bisetion function.

Internal routine for fd4_part_rcb_weight.


fd4_part_rcb_exch_weights

private subroutine fd4_part_rcb_exch_weights (domain, all_blocks, all_blocks_len, err)
    type (fd4_domain), intent(inout), target :: domain
    integer (kind=i_k), intent(in), dimension (3,all_blocks_len) :: all_blocks
    integer (kind=i_k), intent(in) :: all_blocks_len
    integer (kind=i_k), intent(out) :: err
end subroutine fd4_part_rcb_exch_weights
Parameters:
domain the domain
all_blocks array of positions of the blocks in the new partion
all_blocks_len length of all_blocks(3,:)
err error status: 0...ok
Exchange the weight of my blocks with all other processes.

Updates domain%balance%blkweights. This is a copy from fd4_part_sfc with modifications (argument all_blocks).

Internal routine.

See also: module fd4_part_sfc_mod