module fd4_globaldef_mod module fd4_domain_mod module fd4_iter_mod module fd4_mpi_mod module hilbert_mod module mrgrnk_mod module stack_mod module rbtree_fd4_block_modVariables:
integer (kind=i_k), public, parameter :: FD4_PART_SFC_SIMPLE = 1 integer (kind=i_k), public, parameter :: FD4_PART_SFC_BINSRCH = 2 integer (kind=i_k), public, parameter :: FD4_PART_SFC_PARALLEL = 3Subroutines and functions:
private subroutine fd4_part_sfc_part1d_binsrch (nblocks, nprocs, blkweights_ps, maxweight, steps, partition, maxload) private subroutine fd4_part_sfc_part1d_parallel (nblocks, nprocs, blkweights_ps, maxweight, steps, mpi, partition, maxload, err) private subroutine fd4_part_sfc_part1d_simple (nblocks, nprocs, blkweights_ps, partition, maxload) public subroutine fd4_part_sfc_weight (domain, all_blocks, all_blocks_len, local_blocks, local_blocks_len, method, err, opt_blocks_changed) private subroutine fd4_part_sfc_exch_weights (domain, err) public subroutine fd4_part_new (domain, all_blocks, all_blocks_len, local_blocks, local_blocks_len, add_only, opt_blocks_changed)
Author: Matthias Lieber
See also: module hilbert_mod, module fd4_domain_mod
private subroutine fd4_part_sfc_part1d_binsrch (nblocks, nprocs, blkweights_ps, maxweight, steps, partition, maxload) integer (kind=i_k), intent(in) :: nblocks integer (kind=i_k), intent(in) :: nprocs real (kind=r8k), intent(in), dimension (0:nblocks) :: blkweights_ps real (kind=r8k), intent(in) :: maxweight integer (kind=i_k), intent(in) :: steps integer (kind=i_k), intent(out), dimension (0:nprocs) :: partition real (kind=r8k), intent(out) :: maxload end subroutine fd4_part_sfc_part1d_binsrchParameters:
nblocks | number of blocks |
nprocs | number of processes |
blkweights_ps | prefix sum of ordered block weights, weights(0) must be 0 |
maxweight | max weight in weight array |
steps | number of binary search steps to find good bottleneck value |
partition | output partition vector, contains start indices of partitions |
maxload | load of max loaded process |
Algorithm:
private subroutine fd4_part_sfc_part1d_parallel (nblocks, nprocs, blkweights_ps, maxweight, steps, mpi, partition, maxload, err) integer (kind=i_k), intent(in) :: nblocks integer (kind=i_k), intent(in) :: nprocs real (kind=r8k), intent(in), dimension (0:nblocks) :: blkweights_ps real (kind=r8k), intent(in) :: maxweight integer (kind=i_k), intent(in) :: steps type (fd4_mpi), intent(in) :: mpi integer (kind=i_k), intent(out), dimension (0:nprocs) :: partition real (kind=r8k), intent(out) :: maxload integer (kind=i_k), intent(out) :: err end subroutine fd4_part_sfc_part1d_parallelParameters:
nblocks | number of blocks |
nprocs | number of processes |
blkweights_ps | prefix sum of ordered block weights, weights(0) must be 0 |
maxweight | max weight in weight array |
steps | number of binary search steps to find good bottleneck value |
mpi | domain's MPI context |
partition | output partition vector, contains start indices of partitions |
maxload | load of max loaded process |
err | error status: 0...ok |
Algorithm:
private subroutine fd4_part_sfc_part1d_simple (nblocks, nprocs, blkweights_ps, partition, maxload) integer (kind=i_k), intent(in) :: nblocks integer (kind=i_k), intent(in) :: nprocs real (kind=r8k), intent(in), dimension (0:nblocks) :: blkweights_ps integer (kind=i_k), intent(out), dimension (0:nprocs) :: partition real (kind=r8k), intent(out) :: maxload end subroutine fd4_part_sfc_part1d_simpleParameters:
nblocks | number of blocks |
nprocs | number of processes |
blkweights_ps | prefix sum of ordered block weights, weights(0) must be 0 |
partition | output partition vector, contains start indices of partitions |
maxload | load of max loaded process |
Algorithm:
public subroutine fd4_part_sfc_weight (domain, all_blocks, all_blocks_len, local_blocks, local_blocks_len, method, err, opt_blocks_changed) 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 integer (kind=i_k), intent(in) :: method integer (kind=i_k), intent(out) :: err logical, optional, intent(in) :: opt_blocks_changed end subroutine fd4_part_sfc_weightParameters:
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,:) |
method | 1D partitioning method to use |
err | error status: 0...ok |
opt_blocks_changed | tell me if the blocks have changed (created/removed) |
If opt_blocks_changed is present and is set to false: fd4_part_sfc_weight reuses the hilbert indexes and the ranking of blocks by the hilbert index from the last call!
*TODO:*
private subroutine fd4_part_sfc_exch_weights (domain, err) type (fd4_domain), intent(inout), target :: domain integer (kind=i_k), intent(out) :: err end subroutine fd4_part_sfc_exch_weightsParameters:
domain | the domain |
err | error status: 0...ok |
Updates domain%balance%blkweights.
TODO:
public subroutine fd4_part_new (domain, all_blocks, all_blocks_len, local_blocks, local_blocks_len, add_only, opt_blocks_changed) 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 logical, optional, intent(in) :: add_only logical, optional, intent(in) :: opt_blocks_changed end subroutine fd4_part_newParameters:
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,:) |
add_only | only add new blocks, but don't touch existing blocks |
opt_blocks_changed | tell me if the blocks have changed (created/removed) |
The special option add_only effects:
TODO: