Documentation for module dbcsr_tensor_types

DBCSR tensor framework for block-sparse tensor contraction: Types and create/destroy routines.

source: dbcsr_tensor_types.F
Loading...

public Types:

dbcsr_t_distribution_type
...
dbcsr_t_type
...

Generic procedures:

dbcsr_t_create

public Subroutines/Functions:

offset of tensor block
Size of tensor block
SUBROUTINE
dbcsr_t_destroy (tensor)
Destroy a tensor
...
Destroy tensor distribution
Create a tensor distribution.
FUNCTION
INTEGER
dbcsr_t_get_data_type (tensor)
tensor data type
Generalization of dbcsr_get_stored_coordinates for tensors.
Create a default nd process topology that is consistent with a given 2d topology. Purpose: a nd tensor defined on the returned process grid can be represented as a DBCSR matrix with the given 2d topology. This is needed to enable contraction of 2 tensors (must have the same 2d process grid).
SUBROUTINE
dims_tensor (tensor, dims)
tensor dimensions
FUNCTION
INTEGER PURE
ndims_tensor (tensor)
tensor rank

public Types:

TYPE :: dbcsr_t_distribution_type

...


:: dist ...
INTEGER
:: comm_nd ...
:: nd_dist ...

TYPE :: dbcsr_t_type

...


:: matrix_rep ...
:: nd_index_blk ...
:: nd_index ...
:: blk_sizes ...
:: blk_offsets ...
:: nd_dist ...
INTEGER
:: comm_nd ...
LOGICAL
:: comm_prv = .FALSE. ...
LOGICAL
:: valid = .FALSE. ...
:: name ...


Generic procedure dbcsr_t_create

...

INTENT(out)
:: tensor × ×
CHARACTER(*),
INTENT(in)
:: name ×
CHARACTER(*),
INTENT(in),
OPTIONAL
:: name ×
INTENT(inout)
:: dist ×
INTEGER,
INTENT(in)
:: map1_2d(:) ×
INTEGER,
INTENT(in)
:: map2_2d(:) ×
INTEGER,
INTENT(in),
OPTIONAL
:: data_type ×
INTEGER,
INTENT(in),
OPTIONAL
:: blk_size_1(:) ×
INTEGER,
INTENT(in),
OPTIONAL
:: blk_size_2(:) ×
INTEGER,
INTENT(in),
OPTIONAL
:: blk_size_3(:) ×
INTEGER,
INTENT(in),
OPTIONAL
:: blk_size_4(:) ×
INTENT(inout)
:: tensor_in ×

SUBROUTINEdbcsr_t_blk_offsets(tensor, ind, blk_offset)

offset of tensor block

Arguments:
INTENT(in)
:: tensor ...
INTEGER,
INTENT(in)
:: ind(ndims_tensor(tensor)) block index
INTEGER,
INTENT(out)
:: blk_offset(ndims_tensor(tensor)) block offset

SUBROUTINEdbcsr_t_blk_sizes(tensor, ind, blk_size)

Size of tensor block

Arguments:
INTENT(in)
:: tensor ...
INTEGER,
INTENT(in)
:: ind(ndims_tensor(tensor)) block index ...
INTEGER,
INTENT(out)
:: blk_size(ndims_tensor(tensor)) block size ...

SUBROUTINEdbcsr_t_destroy(tensor)

Destroy a tensor

Arguments:
INTENT(inout)
:: tensor ...

FUNCTIONdbcsr_t_distribution(tensor)

...

Return Value ::
Arguments:
INTENT(in)
:: tensor ...

SUBROUTINEdbcsr_t_distribution_destroy(dist)

Destroy tensor distribution

Arguments:
INTENT(inout)
:: dist ...

SUBROUTINEdbcsr_t_distribution_new(dist, comm_nd, comm_2d, map1_2d, map2_2d, nd_dist_1, nd_dist_2, nd_dist_3, nd_dist_4)

Create a tensor distribution.

Arguments:
INTENT(out)
:: dist ...
INTEGER,
INTENT(in)
:: comm_nd communicator with n-dimensional Cartesian topology
INTEGER,
INTENT(in)
:: comm_2d communicator with 2-dimensional topology
INTEGER,
INTENT(in)
:: map1_2d(:) which nd-indices map to first matrix index and in which order
INTEGER,
INTENT(in)
:: map2_2d(:) which nd-indices map to second matrix index and in which order
INTEGER,
INTENT(in),
OPTIONAL
:: nd_dist_1(:) distribution vector for first dimension
INTEGER,
INTENT(in),
OPTIONAL
:: nd_dist_2(:) distribution vector for second dimension
INTEGER,
INTENT(in),
OPTIONAL
:: nd_dist_3(:) ...
INTEGER,
INTENT(in),
OPTIONAL
:: nd_dist_4(:) ...

FUNCTIONdbcsr_t_get_data_type(tensor)

tensor data type

Return Value ::
INTEGER
Arguments:
INTENT(in)
:: tensor ...

SUBROUTINEdbcsr_t_get_stored_coordinates(tensor, ind_nd, processor)

Generalization of dbcsr_get_stored_coordinates for tensors.

Arguments:
INTENT(in)
:: tensor ...
INTEGER,
INTENT(in)
:: ind_nd(ndims_tensor(tensor)) ...
INTEGER,
INTENT(out)
:: processor ...

FUNCTIONdbcsr_t_nd_mp_comm(comm_2d, map1_2d, map2_2d, dims_nd)

Create a default nd process topology that is consistent with a given 2d topology. Purpose: a nd tensor defined on the returned process grid can be represented as a DBCSR matrix with the given 2d topology. This is needed to enable contraction of 2 tensors (must have the same 2d process grid).

Return Value ::
INTEGER
Arguments:
INTEGER,
INTENT(in)
:: comm_2d communicator with 2-dimensional topology
INTEGER,
INTENT(in)
:: map1_2d(:) which nd-indices map to first matrix index and in which order
INTEGER,
INTENT(in)
:: map2_2d(:) which nd-indices map to second matrix index and in which order
INTEGER,
INTENT(in),
OPTIONAL
:: dims_nd(size(map1_2d)+size(map2_2d)) nd dimensions

SUBROUTINEdims_tensor(tensor, dims)

tensor dimensions

Arguments:
INTENT(in)
:: tensor ...
INTEGER,
INTENT(out)
:: dims(ndims_tensor(tensor)) ...

PURE FUNCTIONndims_tensor(tensor)

tensor rank

Return Value ::
INTEGER
Arguments:
INTENT(in)
:: tensor ...

SUBROUTINEdbcsr_t_create_new(tensor, name, dist, map1_2d, map2_2d, data_type, blk_size_1, blk_size_2, blk_size_3, blk_size_4)

create a tensor

Arguments:
INTENT(out)
:: tensor ...
CHARACTER(*),
INTENT(in)
:: name ...
INTENT(inout)
:: dist ...
INTEGER,
INTENT(in)
:: map1_2d(:) which nd-indices to map to first 2d index and in which order
INTEGER,
INTENT(in)
:: map2_2d(:) which nd-indices to map to first 2d index and in which order
INTEGER,
INTENT(in),
OPTIONAL
:: data_type ...
INTEGER,
INTENT(in),
OPTIONAL
:: blk_size_1(:) blk sizes in each dimension
INTEGER,
INTENT(in),
OPTIONAL
:: blk_size_2(:) ...
INTEGER,
INTENT(in),
OPTIONAL
:: blk_size_3(:) ...
INTEGER,
INTENT(in),
OPTIONAL
:: blk_size_4(:) ...

SUBROUTINEdbcsr_t_create_template(tensor_in, tensor, name)

create a tensor from template

Arguments:
INTENT(inout)
:: tensor_in ...
INTENT(out)
:: tensor ...
CHARACTER(*),
INTENT(in),
OPTIONAL
:: name ...