dbcsr_tensor Module

DBCSR tensor framework for block-sparse tensor contraction. Representation of n-rank tensors as DBCSR tall-and-skinny matrices. Support for arbitrary redistribution between different representations. Support for arbitrary tensor contractions \todo implement checks and error messages



Variables

Type Visibility Attributes Name Initial
character(len=*), private, parameter :: moduleN = 'dbcsr_tensor'

Functions

private function update_contraction_storage(storage, split_opt, split) result(do_change_pgrid)

update contraction storage that keeps track of process grids during a batched contraction and decide if tensor process grid needs to be optimized

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_contraction_storage), intent(inout) :: storage
type(dbcsr_tas_split_info), intent(in) :: split_opt

optimized TAS process grid

type(dbcsr_tas_split_info), intent(in) :: split

current TAS process grid

Return Value logical, DIMENSION(2)

private function compat_map(nd_index, compat_ind)

Check if 2d index is compatible with tensor index

Arguments

Type IntentOptional Attributes Name
type(nd_to_2d_mapping), intent(in) :: nd_index
integer, intent(in), DIMENSION(:) :: compat_ind

Return Value integer

private function opt_pgrid(tensor, tas_split_info)

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(in) :: tensor
type(dbcsr_tas_split_info), intent(in) :: tas_split_info

Return Value type(dbcsr_t_pgrid_type)


Subroutines

public subroutine dbcsr_t_copy(tensor_in, tensor_out, order, summation, bounds, move_data, unit_nr)

Copy tensor data. Redistributes tensor data according to distributions of target and source tensor. Permutes tensor index according to order argument (if present). Source and target tensor formats are arbitrary as long as the following requirements are met: * source and target tensors have the same rank and the same sizes in each dimension in terms of tensor elements (block sizes don't need to be the same). If order argument is present, sizes must match after index permutation. OR * target tensor is not yet created, in this case an exact copy of source tensor is returned.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout), TARGET :: tensor_in

Source Target

type(dbcsr_t_type), intent(inout), TARGET :: tensor_out

Source Target

integer, intent(in), optional, DIMENSION(ndims_tensor(tensor_in)) :: order

Permutation of target tensor index. Exact same convention as order argument of RESHAPE intrinsic

logical, intent(in), optional :: summation
integer, intent(in), optional, DIMENSION(2, ndims_tensor(tensor_in)) :: bounds

crop tensor data: start and end index for each tensor dimension

logical, intent(in), optional :: move_data
integer, intent(in), optional :: unit_nr

private subroutine dbcsr_t_copy_expert(tensor_in, tensor_out, order, summation, bounds, move_data, unit_nr)

expert routine for copying a tensor. For internal use only.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout), TARGET :: tensor_in
type(dbcsr_t_type), intent(inout), TARGET :: tensor_out
integer, intent(in), optional, DIMENSION(ndims_tensor(tensor_in)) :: order
logical, intent(in), optional :: summation
integer, intent(in), optional, DIMENSION(2, ndims_tensor(tensor_in)) :: bounds
logical, intent(in), optional :: move_data
integer, intent(in), optional :: unit_nr

private subroutine dbcsr_t_copy_nocomm(tensor_in, tensor_out, summation)

copy without communication, requires that both tensors have same process grid and distribution

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout) :: tensor_in
type(dbcsr_t_type), intent(inout) :: tensor_out
logical, intent(in), optional :: summation

Whether to sum matrices b = a + b

public subroutine dbcsr_t_copy_matrix_to_tensor(matrix_in, tensor_out, summation)

copy matrix to tensor.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_type), intent(in), TARGET :: matrix_in
type(dbcsr_t_type), intent(inout) :: tensor_out
logical, intent(in), optional :: summation

tensor_out = tensor_out + matrix_in

public subroutine dbcsr_t_copy_tensor_to_matrix(tensor_in, matrix_out, summation)

copy tensor to matrix

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout) :: tensor_in
type(dbcsr_type), intent(inout) :: matrix_out
logical, intent(in), optional :: summation

matrix_out = matrix_out + tensor_in

public subroutine dbcsr_t_contract(alpha, tensor_1, tensor_2, beta, tensor_3, contract_1, notcontract_1, contract_2, notcontract_2, map_1, map_2, bounds_1, bounds_2, bounds_3, optimize_dist, pgrid_opt_1, pgrid_opt_2, pgrid_opt_3, filter_eps, flop, move_data, retain_sparsity, unit_nr, log_verbose)

Contract tensors by multiplying matrix representations. tensor_3(map_1, map_2) := alpha * tensor_1(notcontract_1, contract_1) * tensor_2(contract_2, notcontract_2) + beta * tensor_3(map_1, map_2)

Read more…

Arguments

Type IntentOptional Attributes Name
type(dbcsr_scalar_type), intent(in) :: alpha
type(dbcsr_t_type), intent(inout), TARGET :: tensor_1

first tensor (in)

type(dbcsr_t_type), intent(inout), TARGET :: tensor_2

second tensor (in)

type(dbcsr_scalar_type), intent(in) :: beta
type(dbcsr_t_type), intent(inout), TARGET :: tensor_3

contracted tensor (out)

integer, intent(in), DIMENSION(:) :: contract_1

indices of tensor_1 to contract

integer, intent(in), DIMENSION(:) :: notcontract_1

indices of tensor_1 not to contract

integer, intent(in), DIMENSION(:) :: contract_2

indices of tensor_2 to contract (1:1 with contract_1)

integer, intent(in), DIMENSION(:) :: notcontract_2

indices of tensor_2 not to contract

integer, intent(in), DIMENSION(:) :: map_1

which indices of tensor_3 map to non-contracted indices of tensor_1 (1:1 with notcontract_1)

integer, intent(in), DIMENSION(:) :: map_2

which indices of tensor_3 map to non-contracted indices of tensor_2 (1:1 with notcontract_2)

integer, intent(in), optional, DIMENSION(2, SIZE(contract_1)) :: bounds_1

bounds corresponding to contract_1 AKA contract_2: start and end index of an index range over which to contract. For use in batched contraction.

integer, intent(in), optional, DIMENSION(2, SIZE(notcontract_1)) :: bounds_2

bounds corresponding to notcontract_1: start and end index of an index range. For use in batched contraction.

integer, intent(in), optional, DIMENSION(2, SIZE(notcontract_2)) :: bounds_3

bounds corresponding to notcontract_2: start and end index of an index range. For use in batched contraction.

logical, intent(in), optional :: optimize_dist

Whether distribution should be optimized internally. In the current implementation this guarantees optimal parameters only for dense matrices.

type(dbcsr_t_pgrid_type), intent(out), optional, POINTER :: pgrid_opt_1

Optionally return optimal process grid for tensor_1. This can be used to choose optimal process grids for subsequent tensor contractions with tensors of similar shape and sparsity. Under some conditions, pgrid_opt_1 can not be returned, in this case the pointer is not associated.

type(dbcsr_t_pgrid_type), intent(out), optional, POINTER :: pgrid_opt_2

Optionally return optimal process grid for tensor_2.

type(dbcsr_t_pgrid_type), intent(out), optional, POINTER :: pgrid_opt_3

Optionally return optimal process grid for tensor_3.

real(kind=real_8), intent(in), optional :: filter_eps

As in DBCSR mm

integer(kind=int_8), intent(out), optional :: flop

As in DBCSR mm

logical, intent(in), optional :: move_data

memory optimization: transfer data such that tensor_1 and tensor_2 are empty on return

logical, intent(in), optional :: retain_sparsity

enforce the sparsity pattern of the existing tensor_3; default is no

integer, intent(in), optional :: unit_nr

output unit for logging set it to -1 on ranks that should not write (and any valid unit number on ranks that should write output) if 0 on ALL ranks, no output is written

logical, intent(in), optional :: log_verbose

verbose logging (for testing only)

private subroutine dbcsr_t_contract_expert(alpha, tensor_1, tensor_2, beta, tensor_3, contract_1, notcontract_1, contract_2, notcontract_2, map_1, map_2, bounds_1, bounds_2, bounds_3, optimize_dist, pgrid_opt_1, pgrid_opt_2, pgrid_opt_3, filter_eps, flop, move_data, retain_sparsity, nblks_local, result_index, unit_nr, log_verbose)

expert routine for tensor contraction. For internal use only.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_scalar_type), intent(in) :: alpha
type(dbcsr_t_type), intent(inout), TARGET :: tensor_1
type(dbcsr_t_type), intent(inout), TARGET :: tensor_2
type(dbcsr_scalar_type), intent(in) :: beta
type(dbcsr_t_type), intent(inout), TARGET :: tensor_3
integer, intent(in), DIMENSION(:) :: contract_1
integer, intent(in), DIMENSION(:) :: notcontract_1
integer, intent(in), DIMENSION(:) :: contract_2
integer, intent(in), DIMENSION(:) :: notcontract_2
integer, intent(in), DIMENSION(:) :: map_1
integer, intent(in), DIMENSION(:) :: map_2
integer, intent(in), optional, DIMENSION(2, SIZE(contract_1)) :: bounds_1
integer, intent(in), optional, DIMENSION(2, SIZE(notcontract_1)) :: bounds_2
integer, intent(in), optional, DIMENSION(2, SIZE(notcontract_2)) :: bounds_3
logical, intent(in), optional :: optimize_dist
type(dbcsr_t_pgrid_type), intent(out), optional, POINTER :: pgrid_opt_1
type(dbcsr_t_pgrid_type), intent(out), optional, POINTER :: pgrid_opt_2
type(dbcsr_t_pgrid_type), intent(out), optional, POINTER :: pgrid_opt_3
real(kind=real_8), intent(in), optional :: filter_eps
integer(kind=int_8), intent(out), optional :: flop
logical, intent(in), optional :: move_data
logical, intent(in), optional :: retain_sparsity
integer, intent(out), optional :: nblks_local

number of local blocks on this MPI rank

integer, intent(out), optional, DIMENSION(dbcsr_t_max_nblks_local(tensor_3), ndims_tensor(tensor_3)) :: result_index

get indices of non-zero tensor blocks for tensor_3 without actually performing contraction this is an estimate based on block norm multiplication

integer, intent(in), optional :: unit_nr
logical, intent(in), optional :: log_verbose

private subroutine align_tensor(tensor_in, contract_in, notcontract_in, tensor_out, contract_out, notcontract_out, indp_in, indp_out)

align tensor index with data

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout) :: tensor_in
integer, intent(in), DIMENSION(:) :: contract_in
integer, intent(in), DIMENSION(:) :: notcontract_in
type(dbcsr_t_type), intent(out) :: tensor_out
integer, intent(out), DIMENSION(SIZE(contract_in)) :: contract_out
integer, intent(out), DIMENSION(SIZE(notcontract_in)) :: notcontract_out
character(len=1), intent(in), DIMENSION(ndims_tensor(tensor_in)) :: indp_in
character(len=1), intent(out), DIMENSION(ndims_tensor(tensor_in)) :: indp_out

private subroutine reshape_mm_compatible(tensor1, tensor2, tensor1_out, tensor2_out, ind1_free, ind1_linked, ind2_free, ind2_linked, trans1, trans2, new1, new2, ref_tensor, nodata1, nodata2, move_data_1, move_data_2, optimize_dist, unit_nr)

Prepare tensor for contraction: redistribute to a 2d format which can be contracted by matrix multiplication. This routine reshapes the two largest of the three tensors. Redistribution is avoided if tensors already in a consistent layout.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout), TARGET :: tensor1

tensor 1 in

type(dbcsr_t_type), intent(inout), TARGET :: tensor2

tensor 2 in

type(dbcsr_t_type), intent(out), POINTER :: tensor1_out

tensor 1 out tensor 2 out

type(dbcsr_t_type), intent(out), POINTER :: tensor2_out

tensor 1 out tensor 2 out

integer, intent(in), DIMENSION(:) :: ind1_free

indices of tensor 1 that are "free" (not linked to any index of tensor 2)

integer, intent(in), DIMENSION(:) :: ind1_linked

indices of tensor 1 that are linked to indices of tensor 2 1:1 correspondence with ind1_linked

integer, intent(in), DIMENSION(:) :: ind2_free

indices of tensor 1 that are "free" (not linked to any index of tensor 2)

integer, intent(in), DIMENSION(:) :: ind2_linked

indices of tensor 1 that are linked to indices of tensor 2 1:1 correspondence with ind1_linked

character(len=1), intent(out) :: trans1

transpose flag of matrix rep. of tensor 1 transpose flag of matrix rep. tensor 2

character(len=1), intent(out) :: trans2

transpose flag of matrix rep. of tensor 1 transpose flag of matrix rep. tensor 2

logical, intent(out) :: new1

whether a new tensor 1 was created whether a new tensor 2 was created

logical, intent(out) :: new2

whether a new tensor 1 was created whether a new tensor 2 was created

integer, intent(out) :: ref_tensor
logical, intent(in), optional :: nodata1

don't copy data of tensor 1 don't copy data of tensor 2

logical, intent(in), optional :: nodata2

don't copy data of tensor 1 don't copy data of tensor 2

logical, intent(inout), optional :: move_data_1

memory optimization: transfer data s.t. tensor1 may be empty on return memory optimization: transfer data s.t. tensor2 may be empty on return

logical, intent(inout), optional :: move_data_2

memory optimization: transfer data s.t. tensor1 may be empty on return memory optimization: transfer data s.t. tensor2 may be empty on return

logical, intent(in), optional :: optimize_dist

experimental: optimize distribution

integer, intent(in), optional :: unit_nr

output unit

private subroutine reshape_mm_small(tensor_in, ind1, ind2, tensor_out, trans, new, nodata, move_data, unit_nr)

Prepare tensor for contraction: redistribute to a 2d format which can be contracted by matrix multiplication. This routine reshapes the smallest of the three tensors.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout), TARGET :: tensor_in

tensor in

integer, intent(in), DIMENSION(:) :: ind1

index that should be mapped to first matrix dimension index that should be mapped to second matrix dimension

integer, intent(in), DIMENSION(:) :: ind2

index that should be mapped to first matrix dimension index that should be mapped to second matrix dimension

type(dbcsr_t_type), intent(out), POINTER :: tensor_out

tensor out

character(len=1), intent(out) :: trans

transpose flag of matrix rep.

logical, intent(out) :: new

whether a new tensor was created for tensor_out

logical, intent(in), optional :: nodata

don't copy tensor data memory optimization: transfer data s.t. tensor_in may be empty on return

logical, intent(in), optional :: move_data

don't copy tensor data memory optimization: transfer data s.t. tensor_in may be empty on return

integer, intent(in), optional :: unit_nr

output unit

private subroutine invert_transpose_flag(trans_flag)

Arguments

Type IntentOptional Attributes Name
character(len=1), intent(inout) :: trans_flag

private subroutine index_linked_sort(ind_ref, ind_dep)

Arguments

Type IntentOptional Attributes Name
integer, intent(inout), DIMENSION(:) :: ind_ref
integer, intent(inout), DIMENSION(:) :: ind_dep

private subroutine dbcsr_t_remap(tensor_in, map1_2d, map2_2d, tensor_out, comm_2d, dist1, dist2, mp_dims_1, mp_dims_2, name, nodata, move_data)

Copy tensor to tensor with modified index mapping

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout) :: tensor_in
integer, intent(in), DIMENSION(:) :: map1_2d

new index mapping new index mapping

integer, intent(in), DIMENSION(:) :: map2_2d

new index mapping new index mapping

type(dbcsr_t_type), intent(out) :: tensor_out
type(mp_comm_type), intent(in), optional :: comm_2d
type(array_list), intent(in), optional :: dist1
type(array_list), intent(in), optional :: dist2
integer, optional, DIMENSION(SIZE(map1_2d)) :: mp_dims_1
integer, optional, DIMENSION(SIZE(map2_2d)) :: mp_dims_2
character(len=*), intent(in), optional :: name
logical, intent(in), optional :: nodata
logical, intent(in), optional :: move_data

private subroutine dbcsr_t_align_index(tensor_in, tensor_out, order)

Align index with data

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout) :: tensor_in
type(dbcsr_t_type), intent(out) :: tensor_out
integer, intent(out), optional, DIMENSION(ndims_tensor(tensor_in)) :: order

permutation resulting from alignment

private subroutine dbcsr_t_permute_index(tensor_in, tensor_out, order)

Create new tensor by reordering index, data is copied exactly (shallow copy)

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout) :: tensor_in
type(dbcsr_t_type), intent(out) :: tensor_out
integer, intent(in), DIMENSION(ndims_tensor(tensor_in)) :: order

public subroutine dbcsr_t_contract_index(alpha, tensor_1, tensor_2, beta, tensor_3, contract_1, notcontract_1, contract_2, notcontract_2, map_1, map_2, bounds_1, bounds_2, bounds_3, filter_eps, nblks_local, result_index)

get indices of non-zero tensor blocks for contraction result without actually performing contraction. this is an estimate based on block norm multiplication. See documentation of dbcsr_t_contract.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_scalar_type), intent(in) :: alpha
type(dbcsr_t_type), intent(inout), TARGET :: tensor_1
type(dbcsr_t_type), intent(inout), TARGET :: tensor_2
type(dbcsr_scalar_type), intent(in) :: beta
type(dbcsr_t_type), intent(inout), TARGET :: tensor_3
integer, intent(in), DIMENSION(:) :: contract_1
integer, intent(in), DIMENSION(:) :: notcontract_1
integer, intent(in), DIMENSION(:) :: contract_2
integer, intent(in), DIMENSION(:) :: notcontract_2
integer, intent(in), DIMENSION(:) :: map_1
integer, intent(in), DIMENSION(:) :: map_2
integer, intent(in), optional, DIMENSION(2, SIZE(contract_1)) :: bounds_1
integer, intent(in), optional, DIMENSION(2, SIZE(notcontract_1)) :: bounds_2
integer, intent(in), optional, DIMENSION(2, SIZE(notcontract_2)) :: bounds_3
real(kind=real_8), intent(in), optional :: filter_eps
integer, intent(out) :: nblks_local

number of local blocks on this MPI rank

integer, intent(out), DIMENSION(dbcsr_t_max_nblks_local(tensor_3), ndims_tensor(tensor_3)) :: result_index

indices of local non-zero tensor blocks for tensor_3 only the elements result_index(:nblks_local, :) are relevant (all others are set to 0)

private subroutine dbcsr_t_map_bounds_to_tensors(tensor_1, tensor_2, contract_1, notcontract_1, contract_2, notcontract_2, bounds_t1, bounds_t2, bounds_1, bounds_2, bounds_3, do_crop_1, do_crop_2)

Map contraction bounds to bounds referring to tensor indices see dbcsr_t_contract for docu of dummy arguments

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(in) :: tensor_1
type(dbcsr_t_type), intent(in) :: tensor_2
integer, intent(in), DIMENSION(:) :: contract_1
integer, intent(in), DIMENSION(:) :: notcontract_1
integer, intent(in), DIMENSION(:) :: contract_2
integer, intent(in), DIMENSION(:) :: notcontract_2
integer, intent(out), DIMENSION(2, ndims_tensor(tensor_1)) :: bounds_t1

bounds mapped to tensor_1

integer, intent(out), DIMENSION(2, ndims_tensor(tensor_2)) :: bounds_t2

bounds mapped to tensor_2

integer, intent(in), optional, DIMENSION(2, SIZE(contract_1)) :: bounds_1
integer, intent(in), optional, DIMENSION(2, SIZE(notcontract_1)) :: bounds_2
integer, intent(in), optional, DIMENSION(2, SIZE(notcontract_2)) :: bounds_3
logical, intent(out), optional :: do_crop_1

whether tensor 1 should be cropped whether tensor 2 should be cropped

logical, intent(out), optional :: do_crop_2

whether tensor 1 should be cropped whether tensor 2 should be cropped

private subroutine dbcsr_t_print_contraction_index(tensor_1, indchar1, tensor_2, indchar2, tensor_3, indchar3, unit_nr)

print tensor contraction indices in a human readable way

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(in) :: tensor_1
character(len=1), intent(in), DIMENSION(ndims_tensor(tensor_1)) :: indchar1

characters printed for index of tensor 1

type(dbcsr_t_type), intent(in) :: tensor_2
character(len=1), intent(in), DIMENSION(ndims_tensor(tensor_2)) :: indchar2

characters printed for index of tensor 2

type(dbcsr_t_type), intent(in) :: tensor_3
character(len=1), intent(in), DIMENSION(ndims_tensor(tensor_3)) :: indchar3

characters printed for index of tensor 3

integer, intent(in) :: unit_nr

output unit

public subroutine dbcsr_t_batched_contract_init(tensor, batch_range_1, batch_range_2, batch_range_3, batch_range_4)

Initialize batched contraction for this tensor.

Read more…

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout) :: tensor
integer, intent(in), optional, DIMENSION(:) :: batch_range_1

For internal load balancing optimizations, optionally specify the index ranges of batched contraction. batch_range_i refers to the ith tensor dimension and contains all block indices starting a new range. The size should be the number of ranges plus one, the last element being the block index plus one of the last block in the last range.

integer, intent(in), optional, DIMENSION(:) :: batch_range_2

For internal load balancing optimizations, optionally specify the index ranges of batched contraction. batch_range_i refers to the ith tensor dimension and contains all block indices starting a new range. The size should be the number of ranges plus one, the last element being the block index plus one of the last block in the last range.

integer, intent(in), optional, DIMENSION(:) :: batch_range_3

For internal load balancing optimizations, optionally specify the index ranges of batched contraction. batch_range_i refers to the ith tensor dimension and contains all block indices starting a new range. The size should be the number of ranges plus one, the last element being the block index plus one of the last block in the last range.

integer, intent(in), optional, DIMENSION(:) :: batch_range_4

For internal load balancing optimizations, optionally specify the index ranges of batched contraction. batch_range_i refers to the ith tensor dimension and contains all block indices starting a new range. The size should be the number of ranges plus one, the last element being the block index plus one of the last block in the last range.

public subroutine dbcsr_t_batched_contract_finalize(tensor, unit_nr)

finalize batched contraction. This performs all communication that has been postponed in the contraction calls.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout) :: tensor
integer, intent(in), optional :: unit_nr

private subroutine dbcsr_t_change_pgrid(tensor, pgrid, batch_range_1, batch_range_2, batch_range_3, batch_range_4, nodata, pgrid_changed, unit_nr)

change the process grid of a tensor

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout) :: tensor
type(dbcsr_t_pgrid_type), intent(in) :: pgrid
integer, intent(in), optional, DIMENSION(:) :: batch_range_1

For internal load balancing optimizations, optionally specify the index ranges of batched contraction. batch_range_i refers to the ith tensor dimension and contains all block indices starting a new range. The size should be the number of ranges plus one, the last element being the block index plus one of the last block in the last range.

integer, intent(in), optional, DIMENSION(:) :: batch_range_2

For internal load balancing optimizations, optionally specify the index ranges of batched contraction. batch_range_i refers to the ith tensor dimension and contains all block indices starting a new range. The size should be the number of ranges plus one, the last element being the block index plus one of the last block in the last range.

integer, intent(in), optional, DIMENSION(:) :: batch_range_3

For internal load balancing optimizations, optionally specify the index ranges of batched contraction. batch_range_i refers to the ith tensor dimension and contains all block indices starting a new range. The size should be the number of ranges plus one, the last element being the block index plus one of the last block in the last range.

integer, intent(in), optional, DIMENSION(:) :: batch_range_4

For internal load balancing optimizations, optionally specify the index ranges of batched contraction. batch_range_i refers to the ith tensor dimension and contains all block indices starting a new range. The size should be the number of ranges plus one, the last element being the block index plus one of the last block in the last range.

logical, intent(in), optional :: nodata

optionally don't copy the tensor data (then tensor is empty on returned)

logical, intent(out), optional :: pgrid_changed
integer, intent(in), optional :: unit_nr

private subroutine dbcsr_t_change_pgrid_2d(tensor, mp_comm, pdims, nodata, nsplit, dimsplit, pgrid_changed, unit_nr)

map tensor to a new 2d process grid for the matrix representation.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_t_type), intent(inout) :: tensor
type(mp_comm_type), intent(in) :: mp_comm
integer, intent(in), optional, DIMENSION(2) :: pdims
logical, intent(in), optional :: nodata
integer, intent(in), optional :: nsplit
integer, intent(in), optional :: dimsplit
logical, intent(out), optional :: pgrid_changed
integer, intent(in), optional :: unit_nr