CP2K 2.4 (Revision 12889)
Classes | Functions | Variables

dbcsr_index_operations Namespace Reference

Operations on the DBCSR index. More...

Classes

interface  dbcsr_count_row_index
interface  dbcsr_build_row_index

Functions

subroutine make_index_canonical (new_row_p, new_col_i, new_blk_p, old_row_p, old_col_i, old_blk_p, matrix)
 Makes a canonical index given the index arrays.
subroutine, public make_index_triangular (new_row_p, new_col_i, new_blk_p, old_row_p, old_col_i, old_blk_p, matrix)
 Makes a CP2K triangular index given the index arrays.
pure subroutine, public dbcsr_make_dbcsr_index (row_p, row_i, nrows, nblks)
 Collapses a row_p index.
pure subroutine, public dbcsr_expand_row_index (row_p, row_i, nrows, nblks)
 Expands a row_p index.
pure subroutine dbcsr_count_row_index_inplace (rows, nrows)
 Counts columns-per-row count from row index array, in-place.
pure subroutine dbcsr_count_row_index_copy (rows, counts, nrows)
 Counts columns-per-row count from row index array.
pure subroutine dbcsr_build_row_index_inplace (rows, nrows)
 Builds row index array from a columns-per-row count, in-place.
pure subroutine dbcsr_build_row_index_copy (counts, rows, nrows)
 Builds row index array from a columns-per-row count.
subroutine, public dbcsr_addto_index_array (matrix, slot, DATA, reservation, extra, error)
 Adds data to the index. Incleases the index size when neccessary.
subroutine, public dbcsr_clearfrom_index_array (matrix, slot)
 The data area was not defined or the new area is greater than the old.
subroutine, public dbcsr_repoint_index (m, slot)
 Updates the index pointers of a bcsr matrix.
subroutine, public dbcsr_make_index_exist (m, error)
 Creates an index for the matrix.
subroutine, public dbcsr_sort_indices (n, row_i, col_i, blk_p, blk_d)
 Sorts the rows & columns of a work matrix.
subroutine, public dbcsr_sort_many_indices (matrix)
 Create an ordering for both rows and columns. If the blk_p must be rearranged, then the col_i array will be used as a permutation vector.
subroutine, public dbcsr_order_matrix_index (matrix, error)
 Sorts the index of a DBCSR.
subroutine, public dbcsr_index_prune_deleted (matrix, error)
 Removes the deleted blocks from the index.
subroutine, public transpose_index_local (new_col_p, new_row_i, old_row_p, old_col_i, new_blk_p, old_blk_p)
 Re-indexes row_p and blk_i according to columns.
subroutine, public dbcsr_make_index_canonical (matrix, cp2k)
 Makes a canonical index to the distribution.
subroutine, public make_dense_index (row_p, col_i, blk_p, nblkrows_total, nblkcols_total, myblkrows, myblkcols, row_blk_offsets, col_blk_offsets, meta, make_tr, error)
 Makes the index for a dense matrix.
subroutine, public make_undense_index (row_p, col_i, blk_p, distribution, local_row_offsets, local_col_offsets, meta)
 Makes a blocked index from a dense matrix.
subroutine, public merge_index_arrays (new_row_i, new_col_i, new_blk_p, new_size, old_row_i, old_col_i, old_blk_p, old_size, add_ip, add_size, new_blk_d, old_blk_d, added_size_offset, added_sizes, added_size, added_nblks, error)
 Merges two indices.
subroutine, public dbcsr_make_index_local_row (matrix, error)
 Converts BCSR global row index to local row index.
subroutine, public dbcsr_make_index_list (matrix, thread_redist, error)
 The existing row_p is converted from an indexing array into a counting array. Because it is later discarded, the counting is done in-place.
subroutine, public dbcsr_index_compact (matrix, error)
 Compacts an index.
subroutine, public dbcsr_index_checksum (matrix, checksum, error)
 Ensures the index pointers are set.
LOGICAL, public dbcsr_has_local_row_index (matrix)

Variables

CHARACTER(len=*), parameter,
private 
moduleN = 'dbcsr_index_operations'
LOGICAL, parameter careful_mod = .FALSE.
LOGICAL, parameter debug_mod = .FALSE.

Detailed Description

Operations on the DBCSR index.

Author:
Urban Borstnik
Date:
2010-02-18
Version:
0.9

Modification history:


Function Documentation

subroutine,public dbcsr_index_operations::dbcsr_addto_index_array ( TYPE(dbcsr_type),intent(inout)  matrix,
INTEGER,intent(in)  slot,
INTEGER,dimension(:),intent(in),optional  DATA,
INTEGER,intent(in),optional  reservation,
INTEGER,intent(in),optional  extra,
TYPE(dbcsr_error_type),intent(inout)  error 
)

Adds data to the index. Incleases the index size when neccessary.

Parameters:
[in,out]matrixbcsr matrix
[in]slotwhich index array to add (e.g., dbcsr_slot_row_blk_sizes)
[in]data(optional) array holding the index data to add to the index array
[in]reservation(optional) only reserve space for subsequent array
[in]extra(optional) reserve extra space for later additions

Definition at line 376 of file dbcsr_index_operations.f90.

References dbcsr_error_handling::dbcsr_caller_error, dbcsr_error_handling::dbcsr_error_set(), dbcsr_error_handling::dbcsr_error_stop(), dbcsr_error_handling::dbcsr_failure_level, dbcsr_error_handling::dbcsr_fatal_level, dbcsr_error_handling::dbcsr_internal_error, dbcsr_types::dbcsr_num_slots, dbcsr_repoint_index(), dbcsr_types::dbcsr_slot_size, debug_mod, and dbcsr_ptr_util::default_resize_factor.

Referenced by dbcsr_work_operations::dbcsr_finalize(), dbcsr_index_compact(), dbcsr_index_prune_deleted(), dbcsr_make_index_exist(), dbcsr_make_index_list(), dbcsr_make_index_local_row(), dbcsr_transformations::dbcsr_make_undense(), dbcsr_work_operations::dbcsr_merge_all(), dbcsr_work_operations::dbcsr_merge_single_wm(), dbcsr_transformations::dbcsr_new_transposed(), dbcsr_block_access::dbcsr_reserve_blocks(), dbcsr_transformations::make_dense(), and dbcsr_work_operations::quick_finalize().

Here is the call graph for this function:

Here is the caller graph for this function:

pure subroutine dbcsr_index_operations::dbcsr_build_row_index_copy ( INTEGER,dimension(1:nrows),intent(in)  counts,
INTEGER,dimension(1:nrows+1),intent(out)  rows,
INTEGER,intent(in)  nrows 
) [private]

Builds row index array from a columns-per-row count.

Parameters:
[in]nrowsnumber of rows
[in]countscount of the number of colums per row
[out]rowscount of the number of colums per row (input); the row_p index (output)

Definition at line 348 of file dbcsr_index_operations.f90.

References dbcsr_build_row_index_inplace().

Here is the call graph for this function:

pure subroutine dbcsr_index_operations::dbcsr_build_row_index_inplace ( INTEGER,dimension(1:nrows+1),intent(inout)  rows,
INTEGER,intent(in)  nrows 
) [private]

Builds row index array from a columns-per-row count, in-place.

Parameters:
[in]nrowsnumber of rows
[in,out]rowscount of the number of colums per row (input); the row_p index (output)

Definition at line 323 of file dbcsr_index_operations.f90.

Referenced by dbcsr_build_row_index_copy(), and dbcsr_make_index_list().

Here is the caller graph for this function:

subroutine,public dbcsr_index_operations::dbcsr_clearfrom_index_array ( TYPE(dbcsr_type),intent(inout)  matrix,
INTEGER,intent(in)  slot 
)

The data area was not defined or the new area is greater than the old.

Removes data from the index.

Parameters:
[in,out]matrixbcsr matrix
[in]slotwhich index array to remove (e.g., dbcsr_slot_row_blk_sizes)

Definition at line 456 of file dbcsr_index_operations.f90.

References dbcsr_error_handling::dbcsr_failure_level, dbcsr_error_handling::dbcsr_fatal_level, dbcsr_error_handling::dbcsr_internal_error, dbcsr_types::dbcsr_num_slots, dbcsr_repoint_index(), dbcsr_types::dbcsr_slot_blk_p, dbcsr_types::dbcsr_slot_col_i, dbcsr_types::dbcsr_slot_coo_l, dbcsr_types::dbcsr_slot_row_p, dbcsr_types::dbcsr_slot_size, dbcsr_types::dbcsr_slot_thr_c, and debug_mod.

Referenced by dbcsr_index_prune_deleted(), dbcsr_make_index_list(), and dbcsr_make_index_local_row().

Here is the call graph for this function:

Here is the caller graph for this function:

pure subroutine dbcsr_index_operations::dbcsr_count_row_index_copy ( INTEGER,dimension(1:nrows+1),intent(in)  rows,
INTEGER,dimension(1:nrows),intent(out)  counts,
INTEGER,intent(in)  nrows 
) [private]

Counts columns-per-row count from row index array.

Parameters:
[in]nrowsnumber of rows
[in]rowsthe row_p index (input)
[out]countsthe count of the number of columns per row

Definition at line 304 of file dbcsr_index_operations.f90.

pure subroutine dbcsr_index_operations::dbcsr_count_row_index_inplace ( INTEGER,dimension(1:nrows+1),intent(inout)  rows,
INTEGER,intent(in)  nrows 
) [private]

Counts columns-per-row count from row index array, in-place.

Parameters:
[in]nrowsnumber of rows
[in,out]rowsthe row_p index (input); the count of the number of columns per row (output)

Definition at line 285 of file dbcsr_index_operations.f90.

pure subroutine,public dbcsr_index_operations::dbcsr_expand_row_index ( INTEGER,dimension(1:nrows+1),intent(in)  row_p,
INTEGER,dimension(1:nblks),intent(out)  row_i,
INTEGER,intent(in)  nrows,
INTEGER,intent(in)  nblks 
)

Expands a row_p index.

Definition at line 265 of file dbcsr_index_operations.f90.

Referenced by dbcsr_operations::dbcsr_add_reserved(), dbcsr_operations::dbcsr_insert_blocks(), dbcsr_make_index_list(), and transpose_index_local().

Here is the caller graph for this function:

LOGICAL,public dbcsr_index_operations::dbcsr_has_local_row_index ( TYPE(dbcsr_obj),intent(inout)  matrix)

Definition at line 1713 of file dbcsr_index_operations.f90.

subroutine,public dbcsr_index_operations::dbcsr_index_checksum ( TYPE(dbcsr_obj),intent(inout)  matrix,
INTEGER,intent(out)  checksum,
TYPE(dbcsr_error_type),intent(inout)  error 
)

Ensures the index pointers are set.

Calculates the checksum of an index.

Parameters:
[in]matrixmatrix for which to make canonical index
[in,out]errorerror

Definition at line 1692 of file dbcsr_index_operations.f90.

References dbcsr_error_handling::dbcsr_error_set(), dbcsr_error_handling::dbcsr_error_stop(), and dbcsr_toollib::joaat_hash().

Here is the call graph for this function:

subroutine,public dbcsr_index_operations::dbcsr_index_compact ( TYPE(dbcsr_obj),intent(inout)  matrix,
TYPE(dbcsr_error_type),intent(inout)  error 
)
subroutine,public dbcsr_index_operations::dbcsr_index_prune_deleted ( TYPE(dbcsr_obj),intent(inout)  matrix,
TYPE(dbcsr_error_type),intent(inout)  error 
)

Removes the deleted blocks from the index.

Description
Parameters:
[in,out]matrixPrune the index of this matrix.
[in,out]errorerror

Definition at line 794 of file dbcsr_index_operations.f90.

References dbcsr_addto_index_array(), dbcsr_clearfrom_index_array(), dbcsr_error_handling::dbcsr_error_set(), dbcsr_error_handling::dbcsr_error_stop(), dbcsr_error_handling::dbcsr_fatal_level, dbcsr_error_handling::dbcsr_internal_error, dbcsr_types::dbcsr_slot_blk_p, dbcsr_types::dbcsr_slot_col_i, dbcsr_types::dbcsr_slot_nblks, and dbcsr_types::dbcsr_slot_row_p.

Here is the call graph for this function:

pure subroutine,public dbcsr_index_operations::dbcsr_make_dbcsr_index ( INTEGER,dimension(1:nrows+1),intent(out)  row_p,
INTEGER,dimension(1:nblks),intent(in)  row_i,
INTEGER,intent(in)  nrows,
INTEGER,intent(in)  nblks 
)

Collapses a row_p index.

Definition at line 232 of file dbcsr_index_operations.f90.

Referenced by make_index_canonical(), make_index_triangular(), and transpose_index_local().

Here is the caller graph for this function:

subroutine,public dbcsr_index_operations::dbcsr_make_index_canonical ( TYPE(dbcsr_obj),intent(inout)  matrix,
LOGICAL,intent(in),optional  cp2k 
)

Makes a canonical index to the distribution.

Canonical means that it respects the distribution.
Parameters:
inout]matrix matrix for which to make canonical index
[in]cp2k(optional) make CP2K triangular index from canonical; default is false

Definition at line 918 of file dbcsr_index_operations.f90.

References make_index_canonical(), and make_index_triangular().

Here is the call graph for this function:

subroutine,public dbcsr_index_operations::dbcsr_make_index_exist ( TYPE(dbcsr_type),intent(inout)  m,
TYPE(dbcsr_error_type),intent(inout)  error 
)
subroutine,public dbcsr_index_operations::dbcsr_make_index_list ( TYPE(dbcsr_obj),intent(inout)  matrix,
LOGICAL,intent(in)  thread_redist,
TYPE(dbcsr_error_type),intent(inout)  error 
)

The existing row_p is converted from an indexing array into a counting array. Because it is later discarded, the counting is done in-place.

The counts are mapped to local rows, then converted into an index. The local row index replaces the global one. Finally the matrix is designated as having a local-based index. Converts BCSR index into list indices (similar to work matrices)

Parameters:
[in,out]matrixmatrix for which to make canonical index
[in]thread_redistmake a thread subdistribution
[in,out]errorerror

Definition at line 1385 of file dbcsr_index_operations.f90.

References dbcsr_addto_index_array(), dbcsr_build_row_index_inplace(), dbcsr_error_handling::dbcsr_caller_error, dbcsr_clearfrom_index_array(), dbcsr_methods::dbcsr_distribution(), dbcsr_methods::dbcsr_distribution_thread_dist(), dbcsr_error_handling::dbcsr_error_set(), dbcsr_error_handling::dbcsr_error_stop(), dbcsr_expand_row_index(), dbcsr_error_handling::dbcsr_fatal_level, dbcsr_error_handling::dbcsr_internal_error, dbcsr_types::dbcsr_slot_blk_p, dbcsr_types::dbcsr_slot_col_i, dbcsr_types::dbcsr_slot_coo_l, dbcsr_types::dbcsr_slot_row_p, dbcsr_types::dbcsr_slot_thr_c, dbcsr_error_handling::dbcsr_unimplemented_error_nr, and dbcsr_error_handling::dbcsr_wrong_args_error.

Here is the call graph for this function:

subroutine,public dbcsr_index_operations::dbcsr_make_index_local_row ( TYPE(dbcsr_obj),intent(inout)  matrix,
TYPE(dbcsr_error_type),intent(inout)  error 
)
subroutine,public dbcsr_index_operations::dbcsr_order_matrix_index ( TYPE(dbcsr_obj),intent(inout)  matrix,
TYPE(dbcsr_error_type),intent(inout)  error 
)

Sorts the index of a DBCSR.

Description
Sorts the row and column indices so that the rows monotonically increase and the columns monotonically increase within each row.
Parameters:
[in,out]matrixmatrix for which to sort
[in,out]errorerror

Definition at line 738 of file dbcsr_index_operations.f90.

References dbcsr_error_handling::dbcsr_error_set(), dbcsr_error_handling::dbcsr_error_stop(), dbcsr_methods::dbcsr_nblkcols_total(), and dbcsr_methods::dbcsr_nblkrows_total().

Here is the call graph for this function:

subroutine,public dbcsr_index_operations::dbcsr_repoint_index ( TYPE(dbcsr_type),intent(inout)  m,
INTEGER,intent(in),optional  slot 
)

Updates the index pointers of a bcsr matrix.

Parameters:
[in,out]mmatrix for which index pointers are updated
[in]slot(optional) only repoint this index

Definition at line 499 of file dbcsr_index_operations.f90.

References dbcsr_types::dbcsr_slot_blk_p, dbcsr_types::dbcsr_slot_col_i, dbcsr_types::dbcsr_slot_coo_l, dbcsr_types::dbcsr_slot_nblks, dbcsr_types::dbcsr_slot_nze, dbcsr_types::dbcsr_slot_row_p, and dbcsr_types::dbcsr_slot_thr_c.

Referenced by dbcsr_addto_index_array(), dbcsr_clearfrom_index_array(), dbcsr_index_compact(), and dbcsr_make_index_exist().

Here is the caller graph for this function:

subroutine,public dbcsr_index_operations::dbcsr_sort_indices ( INTEGER,intent(in)  n,
INTEGER,dimension(1:n),intent(inout)  row_i,
INTEGER,dimension(1:n),intent(inout)  col_i,
INTEGER,dimension(1:n),intent(inout),optional  blk_p,
INTEGER,dimension(1:n),intent(inout),optional  blk_d 
)

Sorts the rows & columns of a work matrix.

Description
Sorts the row and column indices so that the rows monotonically increase and the columns monotonically increase within each row. Passing the blk_p array rearranges the block pointers accordingly. This must be done if they are pointing to valid data, otherwise they become invalid.
Parameters:
[in]nnumber of blocks (elements) to sort
[in,out]row_irow indices
[in,out]col_icolumn indices
[in,out]blk_p(optional) block pointers
[in,out]blk_d(optional) data storage

Definition at line 629 of file dbcsr_index_operations.f90.

References dbcsr_error_handling::dbcsr_caller_error, dbcsr_error_handling::dbcsr_error_set(), dbcsr_error_handling::dbcsr_error_stop(), dbcsr_error_handling::dbcsr_failure_level, dbcsr_error_handling::dbcsr_fatal_level, dbcsr_error_handling::dbcsr_internal_error, debug_mod, and dbcsr_kinds::int_4.

Referenced by dbcsr_sort_many_indices(), make_index_canonical(), make_index_triangular(), and transpose_index_local().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public dbcsr_index_operations::dbcsr_sort_many_indices ( TYPE(dbcsr_type),intent(inout)  matrix)

Create an ordering for both rows and columns. If the blk_p must be rearranged, then the col_i array will be used as a permutation vector.

Now do a nice quicksort. Sorts all work matrices.

Parameters:
[in,out]matrixsort work matrices in this matrix

Definition at line 709 of file dbcsr_index_operations.f90.

References dbcsr_sort_indices(), and dbcsr_methods::dbcsr_wm_use_mutable().

Here is the call graph for this function:

subroutine,public dbcsr_index_operations::make_dense_index ( INTEGER,dimension(1:nblkrows_total+1),intent(out)  row_p,
INTEGER,dimension(:),intent(out)  col_i,
INTEGER,dimension(:),intent(out)  blk_p,
INTEGER,intent(in)  nblkrows_total,
INTEGER,intent(in)  nblkcols_total,
INTEGER,dimension(:),intent(in)  myblkrows,
INTEGER,dimension(:),intent(in)  myblkcols,
INTEGER,dimension(:),intent(in)  row_blk_offsets,
INTEGER,dimension(:),intent(in)  col_blk_offsets,
INTEGER,dimension(dbcsr_meta_size),intent(inout)  meta,
LOGICAL,intent(in),optional  make_tr,
TYPE(dbcsr_error_type),intent(inout)  error 
)

Makes the index for a dense matrix.

Parameters:
[out]row_p,col_i,blk_pStorage for new index
[in,out]distributionDistribution for matrix
[in,out]matrixMatrix
[in,out]metaMetadata updates for new index
[in]nblkrows_totalTotal blocked rows
[in]nblkcols_totalTotal blocked columns
[in]myblkrowsList of blocked rows in my process row
[in]myblkcolsList of blocked columns in my process column
[in]make_trDense blocks are transposed
Note:
Used for making matrices dense/undense

Definition at line 965 of file dbcsr_index_operations.f90.

References dbcsr_error_handling::dbcsr_fatal_level, dbcsr_error_handling::dbcsr_internal_error, dbcsr_types::dbcsr_slot_nblkcols_local, dbcsr_types::dbcsr_slot_nblkcols_total, dbcsr_types::dbcsr_slot_nblkrows_local, dbcsr_types::dbcsr_slot_nblkrows_total, debug_mod, and error.

subroutine dbcsr_index_operations::make_index_canonical ( INTEGER,dimension(:),intent(out)  new_row_p,
INTEGER,dimension(:),intent(out)  new_col_i,
INTEGER,dimension(:),intent(out)  new_blk_p,
INTEGER,dimension(:),intent(in)  old_row_p,
INTEGER,dimension(:),intent(in)  old_col_i,
INTEGER,dimension(:),intent(in)  old_blk_p,
TYPE(dbcsr_type),intent(in)  matrix 
) [private]

Makes a canonical index given the index arrays.

Note:
This routine uses hard-coded logic as to what constitutes a canonical ordering
Description of canonical ordering
A non-(anti)symmetric matrix is left as is. Otherwise, the row and column are stored in the position prescribed by the distribution.

Definition at line 102 of file dbcsr_index_operations.f90.

References dbcsr_make_dbcsr_index(), dbcsr_sort_indices(), debug_mod, and dbcsr_dist_operations::get_stored_canonical().

Referenced by dbcsr_make_index_canonical().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public dbcsr_index_operations::make_index_triangular ( INTEGER,dimension(:),intent(out)  new_row_p,
INTEGER,dimension(:),intent(out)  new_col_i,
INTEGER,dimension(:),intent(out)  new_blk_p,
INTEGER,dimension(:),intent(in)  old_row_p,
INTEGER,dimension(:),intent(in)  old_col_i,
INTEGER,dimension(:),intent(in)  old_blk_p,
TYPE(dbcsr_type),intent(in)  matrix 
)

Makes a CP2K triangular index given the index arrays.

Note:
This routine uses hard-coded logic as to what constitutes a canonical ordering
Description of canonical ordering
A non-(anti)symmetric matrix is left as is. Otherwise, the row and column are stored in the position prescribed by the distribution.

Definition at line 169 of file dbcsr_index_operations.f90.

References dbcsr_make_dbcsr_index(), dbcsr_sort_indices(), debug_mod, and dbcsr_dist_operations::get_stored_canonical().

Referenced by dbcsr_make_index_canonical().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public dbcsr_index_operations::make_undense_index ( INTEGER,dimension(:),intent(out)  row_p,
INTEGER,dimension(:),intent(out)  col_i,
INTEGER,dimension(:),intent(out)  blk_p,
TYPE(dbcsr_distribution_obj)  distribution,
INTEGER,dimension(:),intent(in)  local_row_offsets,
INTEGER,dimension(:),intent(in)  local_col_offsets,
INTEGER,dimension(dbcsr_meta_size),intent(inout)  meta 
)

Makes a blocked index from a dense matrix.

Parameters:
[out]row_p,col_i,blk_pStorage for new index
[in]distributionBlocked distribution
[in]row_blk_offsetsRow block offsets
[in]col_blk_offsetsColumn block offsets
[in,out]metaMetadata updates for new index
Note:
Used for making matrices dense/undense

Definition at line 1052 of file dbcsr_index_operations.f90.

References dbcsr_methods::dbcsr_distribution_local_cols(), dbcsr_methods::dbcsr_distribution_local_rows(), dbcsr_methods::dbcsr_distribution_ncols(), dbcsr_methods::dbcsr_distribution_nlocal_cols(), dbcsr_methods::dbcsr_distribution_nlocal_rows(), dbcsr_methods::dbcsr_distribution_nrows(), dbcsr_types::dbcsr_slot_nblkcols_local, dbcsr_types::dbcsr_slot_nblkcols_total, dbcsr_types::dbcsr_slot_nblkrows_local, dbcsr_types::dbcsr_slot_nblkrows_total, and dbcsr_types::dbcsr_slot_nfullcols_local.

Here is the call graph for this function:

subroutine,public dbcsr_index_operations::merge_index_arrays ( INTEGER,dimension(new_size),intent(out)  new_row_i,
INTEGER,dimension(new_size),intent(out)  new_col_i,
INTEGER,dimension(new_size),intent(out)  new_blk_p,
INTEGER,intent(in)  new_size,
INTEGER,dimension(old_size),intent(in)  old_row_i,
INTEGER,dimension(old_size),intent(in)  old_col_i,
INTEGER,dimension(old_size),intent(in)  old_blk_p,
INTEGER,intent(in)  old_size,
INTEGER,dimension(3, add_size),intent(in)  add_ip,
INTEGER,intent(in)  add_size,
INTEGER,dimension(new_size),intent(out),optional  new_blk_d,
INTEGER,dimension(old_size),intent(in),optional  old_blk_d,
INTEGER,intent(in),optional  added_size_offset,
INTEGER,dimension(:),intent(in),optional  added_sizes,
INTEGER,intent(out),optional  added_size,
INTEGER,intent(out),optional  added_nblks,
TYPE(dbcsr_error_type),intent(inout)  error 
)

Merges two indices.

Note:
Used in local multiply

Assumes they are both pre-sorted

Added sizes
added_size_offset and added_sizes can be optionally specified. This is meant for cases where the added blocks may be duplicates of existing blocks. In this way it is possible to recalculate new block pointers to avoid wasted space.
Parameters:
[in,out]new_row_i,new_col_i,new_blk_pmerged result
[in]new_sizesize of merged index
[in,out]old_row_i,old_col_i,old_blk_pcurrent index
[in]old_sizesize of current index
[in]add_ipindex to add into the current index
[in]add_sizesize of index to add into the current index
[in]added_size_offset(optional) specify base of added sizes
[in]added_sizes(optional) specify sizes of added blocks
[out]added_size(optional) counts number of sizes of added blocks
[out]added_nblks(optional) actual number of new elements
[in,out]errorerror

Definition at line 1134 of file dbcsr_index_operations.f90.

References dbcsr_error_handling::dbcsr_fatal_level, dbcsr_error_handling::dbcsr_internal_error, dbcsr_error_handling::dbcsr_warning_level, dbcsr_error_handling::dbcsr_wrong_args_error, debug_mod, and error.

subroutine,public dbcsr_index_operations::transpose_index_local ( INTEGER,dimension(:),intent(out)  new_col_p,
INTEGER,dimension(:),intent(out)  new_row_i,
INTEGER,dimension(:),intent(in)  old_row_p,
INTEGER,dimension(:),intent(in)  old_col_i,
INTEGER,dimension(:),intent(out),optional  new_blk_p,
INTEGER,dimension(:),intent(in),optional  old_blk_p 
)

Re-indexes row_p and blk_i according to columns.

The re-indexing is equivalent to a local-only transpose.
Parameters:
[out]new_col_pnew column pointer
[out]new_row_inew row index
[in]old_row_pold row pointer
[in]old_col_iold column index
[out]new_blk_p(optional) new block pointer
[in]old_blk_p(optional) old block pointer

Definition at line 875 of file dbcsr_index_operations.f90.

References dbcsr_error_handling::dbcsr_error_set(), dbcsr_error_handling::dbcsr_error_stop(), dbcsr_expand_row_index(), dbcsr_make_dbcsr_index(), and dbcsr_sort_indices().

Here is the call graph for this function:


Variable Documentation

LOGICAL,parameter dbcsr_index_operations::careful_mod = .FALSE.

Definition at line 55 of file dbcsr_index_operations.f90.

Referenced by dbcsr_index_compact(), and dbcsr_make_index_local_row().

LOGICAL,parameter dbcsr_index_operations::debug_mod = .FALSE.
CHARACTER(len=*),parameter,private dbcsr_index_operations::moduleN = 'dbcsr_index_operations'

Definition at line 52 of file dbcsr_index_operations.f90.