22 dbcsr_type_antisymmetric, dbcsr_type_no_symmetry, dbcsr_type_symmetric
27#include "../base/base_uses.f90"
35 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'arnoldi_vector'
46 TYPE(ele_type),
DIMENSION(:),
POINTER :: table => null()
50 END TYPE hash_table_type
56 REAL(real_8),
DIMENSION(:, :),
POINTER :: ptr => null()
57 INTEGER :: assigned_thread = -1
60 TYPE fast_vec_access_type
61 TYPE(hash_table_type) :: hash_table = hash_table_type()
62 TYPE(block_ptr),
DIMENSION(:),
ALLOCATABLE :: blk_map
86 CHARACTER(LEN=*),
PARAMETER :: routinen =
'create_col_vec_from_matrix'
88 INTEGER :: handle, npcols
89 INTEGER,
DIMENSION(:),
POINTER :: col_blk_size, col_dist, row_blk_size, &
93 CALL timeset(routinen, handle)
95 CALL dbcsr_get_info(matrix, row_blk_size=row_blk_size, distribution=dist)
98 ALLOCATE (col_dist(1), col_blk_size(1))
100 col_blk_size(1) = ncol
103 CALL dbcsr_create(dbcsr_vec,
"D", dist_col_vec, matrix_type=dbcsr_type_no_symmetry, &
104 row_blk_size=row_blk_size, col_blk_size=col_blk_size)
108 DEALLOCATE (col_dist, col_blk_size)
109 CALL timestop(handle)
126 CHARACTER(LEN=*),
PARAMETER :: routinen =
'create_row_vec_from_matrix'
128 INTEGER :: handle, nprows
129 INTEGER,
DIMENSION(:),
POINTER :: col_blk_size, col_dist, row_blk_size, &
133 CALL timeset(routinen, handle)
135 CALL dbcsr_get_info(matrix, col_blk_size=col_blk_size, distribution=dist)
138 ALLOCATE (row_dist(1), row_blk_size(1))
140 row_blk_size(1) = nrow
143 CALL dbcsr_create(dbcsr_vec,
"D", dist_row_vec, matrix_type=dbcsr_type_no_symmetry, &
144 row_blk_size=row_blk_size, col_blk_size=col_blk_size)
148 DEALLOCATE (row_dist, row_blk_size)
149 CALL timestop(handle)
166 CHARACTER(LEN=*),
PARAMETER :: routinen =
'create_replicated_col_vec_from_matrix'
168 INTEGER :: handle, i, npcols
169 INTEGER,
DIMENSION(:),
POINTER :: col_blk_size, col_dist, row_blk_size, &
173 CALL timeset(routinen, handle)
175 CALL dbcsr_get_info(matrix, row_blk_size=row_blk_size, distribution=dist)
178 ALLOCATE (col_dist(npcols), col_blk_size(npcols))
179 col_blk_size(:) = ncol
185 CALL dbcsr_create(dbcsr_vec,
"D", dist_col_vec, matrix_type=dbcsr_type_no_symmetry, &
186 row_blk_size=row_blk_size, col_blk_size=col_blk_size)
190 DEALLOCATE (col_dist, col_blk_size)
191 CALL timestop(handle)
208 CHARACTER(LEN=*),
PARAMETER :: routinen =
'create_replicated_row_vec_from_matrix'
210 INTEGER :: handle, i, nprows
211 INTEGER,
DIMENSION(:),
POINTER :: col_blk_size, col_dist, row_blk_size, &
215 CALL timeset(routinen, handle)
217 CALL dbcsr_get_info(matrix, distribution=dist, col_blk_size=col_blk_size)
220 ALLOCATE (row_dist(nprows), row_blk_size(nprows))
221 row_blk_size(:) = nrow
227 CALL dbcsr_create(dbcsr_vec,
"D", dist_row_vec, dbcsr_type_no_symmetry, &
228 row_blk_size=row_blk_size, col_blk_size=col_blk_size)
232 DEALLOCATE (row_dist, row_blk_size)
233 CALL timestop(handle)
242 SUBROUTINE create_fast_col_vec_access(vec, fast_vec_access)
244 TYPE(fast_vec_access_type) :: fast_vec_access
246 CHARACTER(LEN=*),
PARAMETER :: routinen =
'create_fast_col_vec_access'
248 INTEGER :: col, handle, iblock, nblk_local, &
250 REAL(kind=
real_8),
DIMENSION(:, :),
POINTER :: vec_bl
253 CALL timeset(routinen, handle)
265 CALL hash_table_create(fast_vec_access%hash_table, 4*nblk_local)
267 ALLOCATE (fast_vec_access%blk_map(0:nblk_local))
270 IF (col .GT. 1) cpabort(
"BUG")
278 CALL hash_table_add(fast_vec_access%hash_table, row, iblock)
279 fast_vec_access%blk_map(iblock)%ptr => vec_bl
280 fast_vec_access%blk_map(iblock)%assigned_thread = mod(iblock, nthreads)
283 CALL timestop(handle)
285 END SUBROUTINE create_fast_col_vec_access
292 SUBROUTINE create_fast_row_vec_access(vec, fast_vec_access)
294 TYPE(fast_vec_access_type) :: fast_vec_access
296 CHARACTER(LEN=*),
PARAMETER :: routinen =
'create_fast_row_vec_access'
298 INTEGER :: col, handle, iblock, nblk_local, &
300 REAL(kind=
real_8),
DIMENSION(:, :),
POINTER :: vec_bl
303 CALL timeset(routinen, handle)
315 CALL hash_table_create(fast_vec_access%hash_table, 4*nblk_local)
317 ALLOCATE (fast_vec_access%blk_map(0:nblk_local))
321 IF (row .GT. 1) cpabort(
"BUG")
329 CALL hash_table_add(fast_vec_access%hash_table, col, iblock)
330 fast_vec_access%blk_map(iblock)%ptr => vec_bl
331 fast_vec_access%blk_map(iblock)%assigned_thread = mod(iblock, nthreads)
335 CALL timestop(handle)
337 END SUBROUTINE create_fast_row_vec_access
343 SUBROUTINE release_fast_vec_access(fast_vec_access)
344 TYPE(fast_vec_access_type) :: fast_vec_access
346 CHARACTER(LEN=*),
PARAMETER :: routinen =
'release_fast_vec_access'
350 CALL timeset(routinen, handle)
352 CALL hash_table_release(fast_vec_access%hash_table)
353 DEALLOCATE (fast_vec_access%blk_map)
355 CALL timestop(handle)
357 END SUBROUTINE release_fast_vec_access
372 FUNCTION matching_prime(i)
RESULT(res)
373 INTEGER,
INTENT(IN) :: i
382 IF (mod(res, j) == 0)
THEN
396 SUBROUTINE hash_table_create(hash_table, table_size)
397 TYPE(hash_table_type) :: hash_table
398 INTEGER,
INTENT(IN) :: table_size
405 DO WHILE (2**j - 1 < table_size)
408 hash_table%nmax = 2**j - 1
409 hash_table%prime = matching_prime(hash_table%nmax)
411 ALLOCATE (hash_table%table(0:hash_table%nmax))
412 END SUBROUTINE hash_table_create
418 SUBROUTINE hash_table_release(hash_table)
419 TYPE(hash_table_type) :: hash_table
423 DEALLOCATE (hash_table%table)
425 END SUBROUTINE hash_table_release
433 RECURSIVE SUBROUTINE hash_table_add(hash_table, c, p)
434 TYPE(hash_table_type),
INTENT(INOUT) :: hash_table
435 INTEGER,
INTENT(IN) :: c, p
437 REAL(kind=
real_8),
PARAMETER :: hash_table_expand = 1.5_real_8, &
438 inv_hash_table_fill = 2.5_real_8
441 TYPE(ele_type),
ALLOCATABLE,
DIMENSION(:) :: tmp_hash
445 IF (hash_table%nele*inv_hash_table_fill > hash_table%nmax)
THEN
446 ALLOCATE (tmp_hash(lbound(hash_table%table, 1):ubound(hash_table%table, 1)))
447 tmp_hash(:) = hash_table%table
448 CALL hash_table_release(hash_table)
449 CALL hash_table_create(hash_table, int((ubound(tmp_hash, 1) + 8)*hash_table_expand))
450 DO i = lbound(tmp_hash, 1), ubound(tmp_hash, 1)
451 IF (tmp_hash(i)%c .NE. 0)
THEN
452 CALL hash_table_add(hash_table, tmp_hash(i)%c, tmp_hash(i)%p)
455 DEALLOCATE (tmp_hash)
458 hash_table%nele = hash_table%nele + 1
459 i = iand(c*hash_table%prime, hash_table%nmax)
461 DO j = i, hash_table%nmax
462 IF (hash_table%table(j)%c == 0 .OR. hash_table%table(j)%c == c)
THEN
463 hash_table%table(j)%c = c
464 hash_table%table(j)%p = p
469 IF (hash_table%table(j)%c == 0 .OR. hash_table%table(j)%c == c)
THEN
470 hash_table%table(j)%c = c
471 hash_table%table(j)%p = p
476 END SUBROUTINE hash_table_add
484 PURE FUNCTION hash_table_get(hash_table, c)
RESULT(p)
485 TYPE(hash_table_type),
INTENT(IN) :: hash_table
486 INTEGER,
INTENT(IN) :: c
491 i = iand(c*hash_table%prime, hash_table%nmax)
494 IF (hash_table%table(i)%c == c)
THEN
495 p = hash_table%table(i)%p
499 DO j = i, hash_table%nmax
500 IF (hash_table%table(j)%c == 0 .OR. hash_table%table(j)%c == c)
THEN
501 p = hash_table%table(j)%p
506 IF (hash_table%table(j)%c == 0 .OR. hash_table%table(j)%c == c)
THEN
507 p = hash_table%table(j)%p
515 END FUNCTION hash_table_get
532 REAL(kind=
real_8) :: alpha, beta
535 CHARACTER :: matrix_type
539 SELECT CASE (matrix_type)
540 CASE (dbcsr_type_no_symmetry)
541 CALL dbcsr_matrix_vector_mult(matrix, vec_in, vec_out, alpha, beta, work_row, work_col)
542 CASE (dbcsr_type_symmetric)
543 CALL dbcsr_sym_matrix_vector_mult(matrix, vec_in, vec_out, alpha, beta, work_row, work_col)
544 CASE (dbcsr_type_antisymmetric)
546 cpabort(
"NYI, antisymmetric matrix not permitted")
548 cpabort(
"Unknown matrix type, ...")
563 SUBROUTINE dbcsr_matrix_vector_mult(matrix, vec_in, vec_out, alpha, beta, work_row, work_col)
565 REAL(kind=
real_8) :: alpha, beta
568 CHARACTER(LEN=*),
PARAMETER :: routinen =
'dbcsr_matrix_vector_mult'
570 INTEGER :: col, handle, handle1, ithread, mypcol, &
571 myprow, ncols, nrows, pcol, prow, &
573 REAL(kind=
real_8),
DIMENSION(:),
POINTER :: data_vec
574 REAL(kind=
real_8),
DIMENSION(:, :),
POINTER :: data_d, vec_res
577 TYPE(fast_vec_access_type) :: fast_vec_col, fast_vec_row
580 CALL timeset(routinen, handle)
587 CALL prow_group%set_handle(prow_handle)
589 CALL create_fast_row_vec_access(work_row, fast_vec_row)
590 CALL create_fast_col_vec_access(work_col, fast_vec_col)
593 CALL dbcsr_col_vec_to_rep_row(vec_in, work_col, work_row, fast_vec_col)
600 CALL timeset(routinen//
"_local_mm", handle1)
608 prow = hash_table_get(fast_vec_col%hash_table, row)
609 IF (fast_vec_col%blk_map(prow)%assigned_thread .NE. ithread) cycle
610 pcol = hash_table_get(fast_vec_row%hash_table, col)
611 IF (
SIZE(fast_vec_col%blk_map(prow)%ptr, 1) .EQ. 0 .OR. &
612 SIZE(fast_vec_col%blk_map(prow)%ptr, 2) .EQ. 0 .OR. &
613 SIZE(data_d, 2) .EQ. 0) cycle
614 CALL dgemm(
'N',
'T',
SIZE(fast_vec_col%blk_map(prow)%ptr, 1), &
615 SIZE(fast_vec_col%blk_map(prow)%ptr, 2), &
619 SIZE(fast_vec_col%blk_map(prow)%ptr, 1), &
620 fast_vec_row%blk_map(pcol)%ptr, &
621 SIZE(fast_vec_col%blk_map(prow)%ptr, 2), &
623 fast_vec_col%blk_map(prow)%ptr, &
624 SIZE(fast_vec_col%blk_map(prow)%ptr, 1))
629 CALL timestop(handle1)
633 CALL dbcsr_get_info(matrix=work_col, nfullrows_local=nrows, nfullcols_local=ncols)
634 CALL prow_group%sum(data_vec(1:nrows*ncols))
641 prow = hash_table_get(fast_vec_col%hash_table, row)
642 IF (
ASSOCIATED(fast_vec_col%blk_map(prow)%ptr))
THEN
643 vec_res(:, :) = beta*vec_res(:, :) + alpha*fast_vec_col%blk_map(prow)%ptr(:, :)
645 vec_res(:, :) = beta*vec_res(:, :)
650 CALL release_fast_vec_access(fast_vec_row)
651 CALL release_fast_vec_access(fast_vec_col)
653 CALL timestop(handle)
655 END SUBROUTINE dbcsr_matrix_vector_mult
668 SUBROUTINE dbcsr_matrixt_vector_mult(matrix, vec_in, vec_out, alpha, beta, work_row, work_col, skip_diag)
670 REAL(kind=
real_8) :: alpha, beta
674 CHARACTER(LEN=*),
PARAMETER :: routinen =
'dbcsr_matrixT_vector_mult'
676 INTEGER :: col, col_size, handle, handle1, ithread, &
677 mypcol, myprow, ncols, nrows, pcol, &
678 pcol_handle, prow, prow_handle, row, &
680 REAL(kind=
real_8),
DIMENSION(:),
POINTER :: data_vec
681 REAL(kind=
real_8),
DIMENSION(:, :),
POINTER :: data_d, vec_bl, vec_res
684 TYPE(fast_vec_access_type) :: fast_vec_col, fast_vec_row
687 CALL timeset(routinen, handle)
692 CALL dbcsr_distribution_get(dist, prow_group=prow_handle, pcol_group=pcol_handle, myprow=myprow, mypcol=mypcol)
694 CALL prow_group%set_handle(prow_handle)
695 CALL pcol_group%set_handle(pcol_handle)
697 CALL create_fast_row_vec_access(work_row, fast_vec_row)
698 CALL create_fast_col_vec_access(work_col, fast_vec_col)
707 prow = hash_table_get(fast_vec_col%hash_table, row)
708 fast_vec_col%blk_map(prow)%ptr(1:row_size, 1:col_size) = vec_bl(1:row_size, 1:col_size)
713 CALL prow_group%bcast(data_vec, 0)
716 CALL timeset(routinen//
"local_mm", handle1)
724 IF (skip_diag .AND. col == row) cycle
725 prow = hash_table_get(fast_vec_col%hash_table, row)
726 pcol = hash_table_get(fast_vec_row%hash_table, col)
727 IF (
ASSOCIATED(fast_vec_row%blk_map(pcol)%ptr) .AND. &
728 ASSOCIATED(fast_vec_col%blk_map(prow)%ptr))
THEN
729 IF (fast_vec_row%blk_map(pcol)%assigned_thread .NE. ithread) cycle
730 fast_vec_row%blk_map(pcol)%ptr = fast_vec_row%blk_map(pcol)%ptr + &
731 matmul(transpose(fast_vec_col%blk_map(prow)%ptr), data_d)
733 prow = hash_table_get(fast_vec_row%hash_table, row)
734 pcol = hash_table_get(fast_vec_col%hash_table, col)
735 IF (fast_vec_row%blk_map(prow)%assigned_thread .NE. ithread) cycle
736 fast_vec_row%blk_map(prow)%ptr = fast_vec_row%blk_map(prow)%ptr + &
737 matmul(transpose(fast_vec_col%blk_map(pcol)%ptr), transpose(data_d))
743 CALL timestop(handle1)
748 CALL dbcsr_get_info(matrix=work_row, nfullrows_local=nrows, nfullcols_local=ncols)
749 CALL pcol_group%sum(data_vec(1:nrows*ncols))
752 CALL dbcsr_rep_row_to_rep_col_vec(work_col, work_row, fast_vec_row)
758 prow = hash_table_get(fast_vec_col%hash_table, row)
759 IF (
ASSOCIATED(fast_vec_col%blk_map(prow)%ptr))
THEN
760 vec_res(:, :) = beta*vec_res(:, :) + alpha*fast_vec_col%blk_map(prow)%ptr(:, :)
762 vec_res(:, :) = beta*vec_res(:, :)
767 CALL timestop(handle)
769 END SUBROUTINE dbcsr_matrixt_vector_mult
778 SUBROUTINE dbcsr_col_vec_to_rep_row(vec_in, rep_col_vec, rep_row_vec, fast_vec_col)
779 TYPE(
dbcsr_type) :: vec_in, rep_col_vec, rep_row_vec
780 TYPE(fast_vec_access_type),
INTENT(IN) :: fast_vec_col
782 CHARACTER(LEN=*),
PARAMETER :: routinen =
'dbcsr_col_vec_to_rep_row'
784 INTEGER :: col, handle, mypcol, myprow, ncols, &
785 nrows, pcol_handle, prow_handle, row
786 INTEGER,
DIMENSION(:),
POINTER :: local_cols, row_dist
787 REAL(kind=
real_8),
DIMENSION(:),
POINTER :: data_vec, data_vec_rep
788 REAL(kind=
real_8),
DIMENSION(:, :),
POINTER :: vec_row
793 CALL timeset(routinen, handle)
798 prow_group=prow_handle, &
799 pcol_group=pcol_handle, &
803 CALL prow_group%set_handle(prow_handle)
804 CALL pcol_group%set_handle(pcol_handle)
811 CALL dbcsr_get_info(matrix=rep_col_vec, nfullrows_local=nrows, nfullcols_local=ncols)
814 IF (mypcol == 0) data_vec_rep(1:nrows*ncols) = data_vec(1:nrows*ncols)
816 CALL prow_group%bcast(data_vec_rep(1:nrows*ncols), 0)
826 CALL dbcsr_get_info(matrix=rep_row_vec, nfullrows_local=nrows, local_cols=local_cols, nfullcols_local=ncols)
830 IF (row_dist(col) == myprow)
THEN
831 vec_row = transpose(fast_vec_col%blk_map(hash_table_get(fast_vec_col%hash_table, col))%ptr)
835 CALL dbcsr_get_info(matrix=rep_row_vec, nfullrows_local=nrows, nfullcols_local=ncols)
837 CALL pcol_group%sum(data_vec_rep(1:ncols*nrows))
839 CALL timestop(handle)
841 END SUBROUTINE dbcsr_col_vec_to_rep_row
850 SUBROUTINE dbcsr_rep_row_to_rep_col_vec(rep_col_vec, rep_row_vec, fast_vec_row, fast_vec_col_add)
852 TYPE(fast_vec_access_type) :: fast_vec_row
853 TYPE(fast_vec_access_type),
OPTIONAL :: fast_vec_col_add
855 CHARACTER(LEN=*),
PARAMETER :: routinen =
'dbcsr_rep_row_to_rep_col_vec'
857 INTEGER :: col, handle, mypcol, myprow, ncols, &
858 nrows, prow_handle, row
859 INTEGER,
DIMENSION(:),
POINTER :: col_dist
860 REAL(kind=
real_8),
DIMENSION(:),
POINTER :: data_vec_rep
861 REAL(kind=
real_8),
DIMENSION(:, :),
POINTER :: vec_col
866 CALL timeset(routinen, handle)
869 CALL dbcsr_get_info(matrix=rep_col_vec, distribution=dist_rep_col)
871 prow_group=prow_handle, &
875 CALL prow_group%set_handle(prow_handle)
878 CALL dbcsr_get_info(matrix=rep_row_vec, distribution=dist_rep_row)
886 IF (col_dist(row) == mypcol)
THEN
887 vec_col = transpose(fast_vec_row%blk_map(hash_table_get(fast_vec_row%hash_table, row))%ptr)
891 IF (
PRESENT(fast_vec_col_add))
THEN
892 vec_col = vec_col + fast_vec_col_add%blk_map(hash_table_get(fast_vec_col_add%hash_table, row))%ptr(:, :)
896 CALL dbcsr_get_info(matrix=rep_col_vec, nfullrows_local=nrows, nfullcols_local=ncols)
898 CALL prow_group%sum(data_vec_rep(1:nrows*ncols))
900 CALL timestop(handle)
902 END SUBROUTINE dbcsr_rep_row_to_rep_col_vec
914 SUBROUTINE dbcsr_sym_matrix_vector_mult(matrix, vec_in, vec_out, alpha, beta, work_row, work_col)
916 REAL(kind=
real_8) :: alpha, beta
919 CHARACTER(LEN=*),
PARAMETER :: routinen =
'dbcsr_sym_matrix_vector_mult'
921 INTEGER :: col, handle, handle1, ithread, mypcol, &
922 myprow, ncols, nrows, pcol, &
923 pcol_handle, prow, row, rpcol, rprow, &
925 REAL(kind=
real_8),
DIMENSION(:),
POINTER :: data_vec
926 REAL(kind=
real_8),
DIMENSION(:, :),
POINTER :: data_d, vec_res
930 TYPE(fast_vec_access_type) :: fast_vec_col, fast_vec_row, &
931 res_fast_vec_col, res_fast_vec_row
934 CALL timeset(routinen, handle)
948 CALL pcol_group%set_handle(pcol_handle)
950 CALL create_fast_row_vec_access(work_row, fast_vec_row)
951 CALL create_fast_col_vec_access(work_col, fast_vec_col)
952 CALL create_fast_row_vec_access(result_row, res_fast_vec_row)
953 CALL create_fast_col_vec_access(result_col, res_fast_vec_col)
956 CALL dbcsr_col_vec_to_rep_row(vec_in, work_col, work_row, fast_vec_col)
962 CALL timeset(routinen//
"_local_mm", handle1)
972 pcol = hash_table_get(fast_vec_row%hash_table, col)
973 rprow = hash_table_get(res_fast_vec_col%hash_table, row)
974 IF (
ASSOCIATED(fast_vec_row%blk_map(pcol)%ptr) .AND. &
975 ASSOCIATED(res_fast_vec_col%blk_map(rprow)%ptr))
THEN
976 IF (res_fast_vec_col%blk_map(rprow)%assigned_thread .EQ. ithread)
THEN
977 res_fast_vec_col%blk_map(rprow)%ptr = res_fast_vec_col%blk_map(rprow)%ptr + &
978 matmul(data_d, transpose(fast_vec_row%blk_map(pcol)%ptr))
980 prow = hash_table_get(fast_vec_col%hash_table, row)
981 rpcol = hash_table_get(res_fast_vec_row%hash_table, col)
982 IF (res_fast_vec_row%blk_map(rpcol)%assigned_thread .EQ. ithread .AND. row .NE. col)
THEN
983 res_fast_vec_row%blk_map(rpcol)%ptr = res_fast_vec_row%blk_map(rpcol)%ptr + &
984 matmul(transpose(fast_vec_col%blk_map(prow)%ptr), data_d)
987 rpcol = hash_table_get(res_fast_vec_col%hash_table, col)
988 prow = hash_table_get(fast_vec_row%hash_table, row)
989 IF (res_fast_vec_col%blk_map(rpcol)%assigned_thread .EQ. ithread)
THEN
990 res_fast_vec_col%blk_map(rpcol)%ptr = res_fast_vec_col%blk_map(rpcol)%ptr + &
991 transpose(matmul(fast_vec_row%blk_map(prow)%ptr, data_d))
993 rprow = hash_table_get(res_fast_vec_row%hash_table, row)
994 pcol = hash_table_get(fast_vec_col%hash_table, col)
995 IF (res_fast_vec_row%blk_map(rprow)%assigned_thread .EQ. ithread .AND. row .NE. col)
THEN
996 res_fast_vec_row%blk_map(rprow)%ptr = res_fast_vec_row%blk_map(rprow)%ptr + &
997 transpose(matmul(data_d, fast_vec_col%blk_map(pcol)%ptr))
1004 CALL timestop(handle1)
1008 CALL dbcsr_get_info(matrix=result_row, nfullrows_local=nrows, nfullcols_local=ncols)
1010 CALL pcol_group%sum(data_vec(1:nrows*ncols))
1016 CALL dbcsr_rep_row_to_rep_col_vec(work_col, result_row, res_fast_vec_row, res_fast_vec_col)
1022 prow = hash_table_get(fast_vec_col%hash_table, row)
1023 IF (
ASSOCIATED(fast_vec_col%blk_map(prow)%ptr))
THEN
1024 vec_res(:, :) = beta*vec_res(:, :) + alpha*(fast_vec_col%blk_map(prow)%ptr(:, :))
1026 vec_res(:, :) = beta*vec_res(:, :)
1031 CALL release_fast_vec_access(fast_vec_row)
1032 CALL release_fast_vec_access(fast_vec_col)
1033 CALL release_fast_vec_access(res_fast_vec_row)
1034 CALL release_fast_vec_access(res_fast_vec_col)
1038 CALL timestop(handle)
1040 END SUBROUTINE dbcsr_sym_matrix_vector_mult
static void dgemm(const char transa, const char transb, const int m, const int n, const int k, const double alpha, const double *a, const int lda, const double *b, const int ldb, const double beta, double *c, const int ldc)
Convenient wrapper to hide Fortran nature of dgemm_, swapping a and b.
operations for skinny matrices/vectors expressed in dbcsr form
subroutine, public create_replicated_col_vec_from_matrix(dbcsr_vec, matrix, ncol)
creates a col vector like object whose blocks can be replicated along the processor row and has the s...
subroutine, public create_row_vec_from_matrix(dbcsr_vec, matrix, nrow)
creates a dbcsr row vector like object which lives on proc_row 0 and has the same row dist as the tem...
subroutine, public create_col_vec_from_matrix(dbcsr_vec, matrix, ncol)
creates a dbcsr col vector like object which lives on proc_col 0 and has the same row dist as the tem...
subroutine, public create_replicated_row_vec_from_matrix(dbcsr_vec, matrix, nrow)
creates a row vector like object whose blocks can be replicated along the processor col and has the s...
subroutine, public dbcsr_matrix_colvec_multiply(matrix, vec_in, vec_out, alpha, beta, work_row, work_col)
the real driver routine for the multiply, not all symmetries implemented yet
subroutine, public dbcsr_distribution_release(dist)
...
subroutine, public dbcsr_distribution_new(dist, template, group, pgrid, row_dist, col_dist, reuse_arrays)
...
subroutine, public dbcsr_iterator_next_block(iterator, row, column, block, block_number_argument_has_been_removed, row_size, col_size, row_offset, col_offset)
...
logical function, public dbcsr_iterator_blocks_left(iterator)
...
subroutine, public dbcsr_iterator_stop(iterator)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_get_info(matrix, nblkrows_total, nblkcols_total, nfullrows_total, nfullcols_total, nblkrows_local, nblkcols_local, nfullrows_local, nfullcols_local, my_prow, my_pcol, local_rows, local_cols, proc_row_dist, proc_col_dist, row_blk_size, col_blk_size, row_blk_offset, col_blk_offset, distribution, name, matrix_type, group)
...
real(kind=dp) function, dimension(:), pointer, public dbcsr_get_data_p(matrix, lb, ub)
...
subroutine, public dbcsr_iterator_start(iterator, matrix, shared, dynamic, dynamic_byrows)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_release(matrix)
...
subroutine, public dbcsr_distribution_get(dist, row_dist, col_dist, nrows, ncols, has_threads, group, mynode, numnodes, nprows, npcols, myprow, mypcol, pgrid, subgroups_defined, prow_group, pcol_group)
...
subroutine, public dbcsr_reserve_all_blocks(matrix)
Reserves all blocks.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public real_8
Interface to the message passing library MPI.