39#include "../base/base_uses.f90"
45 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cp_fm_diag_utils'
49 INTEGER :: matrix_order = -1
50 INTEGER :: num_pe_old = -1
51 INTEGER :: num_pe_new = -1
52 INTEGER :: num_pe_opt = -1
53 INTEGER :: num_pe_max_nz_col = -1
54 LOGICAL :: redistribute = .false.
56 PROCEDURE, pass(self) :: write => cp_fm_redistribute_info_write
60 TYPE cp_fm_redistribute_type
62 INTEGER :: a = -1, x = -1
63 LOGICAL :: should_print = .false.
64 LOGICAL :: elpa_force_redistribute = .false.
66 INTEGER,
DIMENSION(:),
POINTER :: group_distribution => null(), &
67 group_partition => null()
70 END TYPE cp_fm_redistribute_type
73 TYPE(cp_fm_redistribute_type),
PRIVATE, &
74 SAVE :: work_redistribute
91 SUBROUTINE cp_fm_redistribute_info_write(self, io_unit)
93 INTEGER,
INTENT(IN) :: io_unit
95 WRITE (unit=io_unit, fmt=
"(A)")
""
96 WRITE (unit=io_unit, fmt=
"(T2,A,T71,I10)") &
97 "CP_FM_DIAG| Number of processes over which the matrix is distributed ", self%num_pe_old, &
98 "CP_FM_DIAG| Matrix order ", self%matrix_order
99 WRITE (unit=io_unit, fmt=
"(T2,A,T71,I10)") &
100 "CP_FM_DIAG| Optimal number of CPUs ", self%num_pe_opt
101 IF (self%num_pe_max_nz_col < 0)
THEN
102 WRITE (unit=io_unit, fmt=
"(T2,A,T71,A10)") &
103 "CP_FM_DIAG| Maximum number of CPUs (with non-zero columns) ",
"<N/A>"
105 WRITE (unit=io_unit, fmt=
"(T2,A,T71,I10)") &
106 "CP_FM_DIAG| Maximum number of CPUs (with non-zero columns): ", self%num_pe_max_nz_col
108 IF (self%redistribute)
THEN
109 WRITE (unit=io_unit, fmt=
"(T2,A,T71,I10)") &
110 "CP_FM_DIAG| Number of processes for the redistribution ", self%num_pe_new
112 WRITE (unit=io_unit, fmt=
"(T2,A)") &
113 "CP_FM_DIAG| The matrix will NOT be redistributed"
115 WRITE (unit=io_unit, fmt=
"(A)")
""
117 END SUBROUTINE cp_fm_redistribute_info_write
125 SUBROUTINE cp_fm_redistribute_work_finalize(has_redistributed)
126 LOGICAL,
INTENT(IN) :: has_redistributed
128 IF (
ASSOCIATED(work_redistribute%group_distribution))
THEN
129 IF (has_redistributed)
THEN
132 CALL work_redistribute%para_env_new%free()
133 DEALLOCATE (work_redistribute%para_env_new)
134 DEALLOCATE (work_redistribute%group_distribution)
135 DEALLOCATE (work_redistribute%group_partition)
138 work_redistribute = cp_fm_redistribute_type()
140 END SUBROUTINE cp_fm_redistribute_work_finalize
156 INTEGER,
INTENT(IN) :: a, x
157 LOGICAL,
INTENT(IN) :: should_print, elpa_force_redistribute
159 work_redistribute%a = a
160 work_redistribute%x = x
161 work_redistribute%should_print = should_print
162 work_redistribute%elpa_force_redistribute = elpa_force_redistribute
164 work_redistribute = cp_fm_redistribute_type()
174 PURE FUNCTION cp_fm_diag_get_optimal_ncpu(size)
RESULT(ncpu)
175 INTEGER,
INTENT(IN) :: size
178 ncpu = ((
size + work_redistribute%a*work_redistribute%x - 1)/ &
179 (work_redistribute%a*work_redistribute%x))*work_redistribute%a
181 END FUNCTION cp_fm_diag_get_optimal_ncpu
183#if defined(__parallel)
191 FUNCTION cp_fm_max_ncpu_non_zero_column(matrix)
RESULT(ncpu)
195 INTEGER :: gcd_max, ipe, jpe, ncol_block, &
196 ncol_global, npcol, nrow_block, &
197 nrow_global, num_pe_old, nzero
198 INTEGER,
DIMENSION(:),
POINTER :: ncol_locals
199 INTEGER,
EXTERNAL :: numroc
201 NULLIFY (ncol_locals)
204 nrow_global=nrow_global, ncol_global=ncol_global, &
205 nrow_block=nrow_block, ncol_block=ncol_block)
206 nzero = count(ncol_locals == 0)
207 num_pe_old = matrix%matrix_struct%para_env%num_pe
208 ncpu = num_pe_old - nzero
212 ncpu = ncpu -
modulo(ncpu, 2)
216 IF (ncpu == num_pe_old)
THEN
227 DO ipe = 1, ceiling(sqrt(real(ncpu,
dp)))
229 IF (ipe*jpe /= ncpu)
THEN
232 IF (
gcd(ipe, jpe) >= gcd_max)
THEN
234 gcd_max =
gcd(ipe, jpe)
241 DO ipe = 0, npcol - 1
242 IF (numroc(ncol_global, ncol_block, ipe, 0, npcol) == 0)
THEN
254 ncpu = ncpu -
modulo(ncpu, 2)
258 END FUNCTION cp_fm_max_ncpu_non_zero_column
277 caller_is_elpa, redist_info)
279 TYPE(
cp_fm_type),
INTENT(IN) :: matrix, eigenvectors
280 TYPE(
cp_fm_type),
INTENT(OUT) :: matrix_new, eigenvectors_new
281 LOGICAL,
OPTIONAL,
INTENT(IN) :: caller_is_elpa
283 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_fm_redistribute_start'
289#if defined(__parallel)
290 REAL(kind=
dp) :: fake_local_data(1, 1)
291 INTEGER :: fake_descriptor(9), mepos_old, &
292 io_unit, ngroups, ncol_block, blksize, nrow_block
299 CALL timeset(routinen, handle)
301 IF (
PRESENT(caller_is_elpa))
THEN
303 is_elpa = caller_is_elpa
305 cpabort(
"CP2K compiled without the ELPA library.")
309#if defined(__parallel)
318 para_env => matrix%matrix_struct%para_env
319 mepos_old = para_env%mepos
324 rdinfo%matrix_order = matrix%matrix_struct%nrow_global
325 rdinfo%num_pe_old = para_env%num_pe
326 rdinfo%num_pe_opt = cp_fm_diag_get_optimal_ncpu(rdinfo%matrix_order)
327 rdinfo%num_pe_new = rdinfo%num_pe_opt
328 rdinfo%num_pe_max_nz_col = -1
329 rdinfo%redistribute = .false.
333 rdinfo%num_pe_new = rdinfo%num_pe_old
338 rdinfo%num_pe_max_nz_col = cp_fm_max_ncpu_non_zero_column(matrix)
341 IF (work_redistribute%elpa_force_redistribute .AND. rdinfo%num_pe_opt < rdinfo%num_pe_max_nz_col)
THEN
344 rdinfo%num_pe_new = rdinfo%num_pe_opt
345 ELSE IF (rdinfo%num_pe_old > rdinfo%num_pe_max_nz_col)
THEN
347 rdinfo%num_pe_new = rdinfo%num_pe_max_nz_col
354 CALL cp_fm_get_info(matrix, ncol_block=ncol_block, nrow_block=nrow_block)
358 DO WHILE (2*blksize <= min(nrow_block, ncol_block))
366 rdinfo%redistribute = (rdinfo%num_pe_old > rdinfo%num_pe_new) .OR. (blksize >= 0 .AND. &
367 ((blksize /= matrix%matrix_struct%ncol_block) .OR. (blksize /= matrix%matrix_struct%nrow_block)))
369 IF (work_redistribute%should_print .AND. io_unit > 0)
THEN
371 IF (work_redistribute%elpa_force_redistribute)
THEN
372 WRITE (unit=io_unit, fmt=
"(T2,A,T78,A3)") &
373 "CP_FM_DIAG| Force redistribute (ELPA):",
"YES"
375 WRITE (unit=io_unit, fmt=
"(T2,A,T79,A2)") &
376 "CP_FM_DIAG| Force redistribute (ELPA):",
"NO"
379 CALL rdinfo%write(io_unit)
384 IF (rdinfo%redistribute)
THEN
386 ALLOCATE (work_redistribute%group_distribution(0:rdinfo%num_pe_old - 1))
387 ALLOCATE (work_redistribute%group_partition(0:1))
388 work_redistribute%group_partition = [rdinfo%num_pe_new, rdinfo%num_pe_old - rdinfo%num_pe_new]
389 ALLOCATE (work_redistribute%para_env_new)
390 CALL work_redistribute%para_env_new%from_split( &
391 comm=para_env, ngroups=ngroups, group_distribution=work_redistribute%group_distribution, &
392 n_subgroups=2, group_partition=work_redistribute%group_partition)
394 IF (work_redistribute%group_distribution(mepos_old) == 0)
THEN
397 NULLIFY (work_redistribute%blacs_env_new)
398 CALL cp_blacs_env_create(blacs_env=work_redistribute%blacs_env_new, para_env=work_redistribute%para_env_new)
401 NULLIFY (fm_struct_new)
402 IF (nrow_block == -1 .OR. ncol_block == -1)
THEN
404 para_env=work_redistribute%para_env_new, &
405 context=work_redistribute%blacs_env_new, &
406 nrow_global=rdinfo%matrix_order, ncol_global=rdinfo%matrix_order, &
407 ncol_block=ncol_block, nrow_block=nrow_block)
410 para_env=work_redistribute%para_env_new, &
411 context=work_redistribute%blacs_env_new, &
412 nrow_global=rdinfo%matrix_order, ncol_global=rdinfo%matrix_order, &
413 ncol_block=ncol_block, nrow_block=nrow_block, force_block=.true.)
415 CALL cp_fm_create(matrix_new, matrix_struct=fm_struct_new, name=
"yevd_new_mat")
416 CALL cp_fm_create(eigenvectors_new, matrix_struct=fm_struct_new, name=
"yevd_new_vec")
420 CALL pdgemr2d(rdinfo%matrix_order, rdinfo%matrix_order, matrix%local_data(1, 1), 1, 1, &
421 matrix%matrix_struct%descriptor, &
422 matrix_new%local_data(1, 1), 1, 1, matrix_new%matrix_struct%descriptor, &
423 matrix%matrix_struct%context)
429 CALL pdgemr2d(rdinfo%matrix_order, rdinfo%matrix_order, matrix%local_data(1, 1), 1, 1, &
430 matrix%matrix_struct%descriptor, &
431 fake_local_data(1, 1), 1, 1, fake_descriptor, &
432 matrix%matrix_struct%context)
437 eigenvectors_new = eigenvectors
440 IF (
PRESENT(redist_info))
THEN
446 mark_used(eigenvectors)
447 mark_used(matrix_new)
448 mark_used(eigenvectors_new)
449 mark_used(redist_info)
450 cpabort(
"Routine called in non-parallel case.")
453 CALL timestop(handle)
472 TYPE(
cp_fm_type),
INTENT(IN) :: matrix, eigenvectors
473 REAL(kind=
dp),
DIMENSION(:),
INTENT(INOUT) :: eig
474 TYPE(
cp_fm_type),
INTENT(INOUT) :: matrix_new, eigenvectors_new
476 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_fm_redistribute_end'
479#if defined(__parallel)
480 REAL(kind=
dp) :: fake_local_data(1, 1)
481 INTEGER :: fake_descriptor(9), mepos_old, n
485 CALL timeset(routinen, handle)
487#if defined(__parallel)
490 IF (
ASSOCIATED(work_redistribute%group_distribution))
THEN
491 n = matrix%matrix_struct%nrow_global
492 para_env => matrix%matrix_struct%para_env
493 mepos_old = para_env%mepos
495 IF (work_redistribute%group_distribution(mepos_old) == 0)
THEN
497 CALL pdgemr2d(n, n, eigenvectors_new%local_data(1, 1), 1, 1, eigenvectors_new%matrix_struct%descriptor, &
498 eigenvectors%local_data(1, 1), 1, 1, eigenvectors%matrix_struct%descriptor, &
499 eigenvectors%matrix_struct%context)
507 CALL pdgemr2d(n, n, fake_local_data(1, 1), 1, 1, fake_descriptor, &
508 eigenvectors%local_data(1, 1), 1, 1, eigenvectors%matrix_struct%descriptor, &
509 eigenvectors%matrix_struct%context)
512 CALL cp_fm_redistribute_work_finalize(work_redistribute%group_distribution(mepos_old) == 0)
515 CALL para_env%bcast(eig, 0)
521 mark_used(eigenvectors)
523 mark_used(matrix_new)
524 mark_used(eigenvectors_new)
525 cpabort(
"Routine called in non-parallel case.")
528 CALL timestop(handle)
532#if defined(__parallel)
539 FUNCTION cp_cfm_max_ncpu_non_zero_column(matrix)
RESULT(ncpu)
543 INTEGER :: gcd_max, ipe, jpe, ncol_block, &
544 ncol_global, npcol, nrow_block, &
545 nrow_global, num_pe_old, nzero
546 INTEGER,
DIMENSION(:),
POINTER :: ncol_locals
547 INTEGER,
EXTERNAL :: numroc
549 NULLIFY (ncol_locals)
552 nrow_global=nrow_global, ncol_global=ncol_global, &
553 nrow_block=nrow_block, ncol_block=ncol_block)
554 nzero = count(ncol_locals == 0)
555 num_pe_old = matrix%matrix_struct%para_env%num_pe
556 ncpu = num_pe_old - nzero
560 ncpu = ncpu -
modulo(ncpu, 2)
564 IF (ncpu == num_pe_old)
THEN
575 DO ipe = 1, ceiling(sqrt(real(ncpu,
dp)))
577 IF (ipe*jpe /= ncpu)
THEN
580 IF (
gcd(ipe, jpe) >= gcd_max)
THEN
582 gcd_max =
gcd(ipe, jpe)
589 DO ipe = 0, npcol - 1
590 IF (numroc(ncol_global, ncol_block, ipe, 0, npcol) == 0)
THEN
602 ncpu = ncpu -
modulo(ncpu, 2)
606 END FUNCTION cp_cfm_max_ncpu_non_zero_column
624 caller_is_elpa, redist_info)
626 TYPE(
cp_cfm_type),
INTENT(IN) :: matrix, eigenvectors
627 TYPE(
cp_cfm_type),
INTENT(OUT) :: matrix_new, eigenvectors_new
628 LOGICAL,
OPTIONAL,
INTENT(IN) :: caller_is_elpa
630 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_cfm_redistribute_start'
636#if defined(__parallel)
637 COMPLEX(KIND=dp) :: fake_local_data(1, 1)
638 INTEGER :: fake_descriptor(9), mepos_old, &
639 io_unit, ngroups, ncol_block, blksize, nrow_block
646 CALL timeset(routinen, handle)
648 IF (
PRESENT(caller_is_elpa))
THEN
650 is_elpa = caller_is_elpa
652 cpabort(
"CP2K compiled without the ELPA library.")
656#if defined(__parallel)
665 para_env => matrix%matrix_struct%para_env
666 mepos_old = para_env%mepos
671 rdinfo%matrix_order = matrix%matrix_struct%nrow_global
672 rdinfo%num_pe_old = para_env%num_pe
673 rdinfo%num_pe_opt = cp_fm_diag_get_optimal_ncpu(rdinfo%matrix_order)
674 rdinfo%num_pe_new = rdinfo%num_pe_opt
675 rdinfo%num_pe_max_nz_col = -1
676 rdinfo%redistribute = .false.
680 rdinfo%num_pe_new = rdinfo%num_pe_old
685 rdinfo%num_pe_max_nz_col = cp_cfm_max_ncpu_non_zero_column(matrix)
688 IF (work_redistribute%elpa_force_redistribute .AND. rdinfo%num_pe_opt < rdinfo%num_pe_max_nz_col)
THEN
691 rdinfo%num_pe_new = rdinfo%num_pe_opt
692 ELSE IF (rdinfo%num_pe_old > rdinfo%num_pe_max_nz_col)
THEN
694 rdinfo%num_pe_new = rdinfo%num_pe_max_nz_col
701 CALL cp_cfm_get_info(matrix, ncol_block=ncol_block, nrow_block=nrow_block)
705 DO WHILE (2*blksize <= min(nrow_block, ncol_block))
713 rdinfo%redistribute = (rdinfo%num_pe_old > rdinfo%num_pe_new) .OR. (blksize >= 0 .AND. &
714 ((blksize /= matrix%matrix_struct%ncol_block) .OR. (blksize /= matrix%matrix_struct%nrow_block)))
716 IF (work_redistribute%should_print .AND. io_unit > 0)
THEN
718 IF (work_redistribute%elpa_force_redistribute)
THEN
719 WRITE (unit=io_unit, fmt=
"(T2,A,T78,A3)") &
720 "CP_FM_DIAG| Force redistribute (ELPA):",
"YES"
722 WRITE (unit=io_unit, fmt=
"(T2,A,T79,A2)") &
723 "CP_FM_DIAG| Force redistribute (ELPA):",
"NO"
726 CALL rdinfo%write(io_unit)
731 IF (rdinfo%redistribute)
THEN
733 ALLOCATE (work_redistribute%group_distribution(0:rdinfo%num_pe_old - 1))
734 ALLOCATE (work_redistribute%group_partition(0:1))
735 work_redistribute%group_partition = [rdinfo%num_pe_new, rdinfo%num_pe_old - rdinfo%num_pe_new]
736 ALLOCATE (work_redistribute%para_env_new)
737 CALL work_redistribute%para_env_new%from_split( &
738 comm=para_env, ngroups=ngroups, group_distribution=work_redistribute%group_distribution, &
739 n_subgroups=2, group_partition=work_redistribute%group_partition)
741 IF (work_redistribute%group_distribution(mepos_old) == 0)
THEN
744 NULLIFY (work_redistribute%blacs_env_new)
745 CALL cp_blacs_env_create(blacs_env=work_redistribute%blacs_env_new, para_env=work_redistribute%para_env_new)
748 NULLIFY (fm_struct_new)
749 IF (nrow_block == -1 .OR. ncol_block == -1)
THEN
751 para_env=work_redistribute%para_env_new, &
752 context=work_redistribute%blacs_env_new, &
753 nrow_global=rdinfo%matrix_order, ncol_global=rdinfo%matrix_order, &
754 ncol_block=ncol_block, nrow_block=nrow_block)
757 para_env=work_redistribute%para_env_new, &
758 context=work_redistribute%blacs_env_new, &
759 nrow_global=rdinfo%matrix_order, ncol_global=rdinfo%matrix_order, &
760 ncol_block=ncol_block, nrow_block=nrow_block, force_block=.true.)
762 CALL cp_cfm_create(matrix_new, matrix_struct=fm_struct_new, name=
"zheevd_new_mat")
763 CALL cp_cfm_create(eigenvectors_new, matrix_struct=fm_struct_new, name=
"zheevd_new_vec")
767 CALL pzgemr2d(rdinfo%matrix_order, rdinfo%matrix_order, matrix%local_data(1, 1), 1, 1, &
768 matrix%matrix_struct%descriptor, &
769 matrix_new%local_data(1, 1), 1, 1, matrix_new%matrix_struct%descriptor, &
770 matrix%matrix_struct%context)
776 CALL pzgemr2d(rdinfo%matrix_order, rdinfo%matrix_order, matrix%local_data(1, 1), 1, 1, &
777 matrix%matrix_struct%descriptor, &
778 fake_local_data(1, 1), 1, 1, fake_descriptor, &
779 matrix%matrix_struct%context)
784 eigenvectors_new = eigenvectors
787 IF (
PRESENT(redist_info))
THEN
793 mark_used(eigenvectors)
794 mark_used(matrix_new)
795 mark_used(eigenvectors_new)
796 mark_used(redist_info)
797 cpabort(
"Routine called in non-parallel case.")
800 CALL timestop(handle)
818 TYPE(
cp_cfm_type),
INTENT(IN) :: matrix, eigenvectors
819 REAL(kind=
dp),
DIMENSION(:),
INTENT(INOUT) :: eig
820 TYPE(
cp_cfm_type),
INTENT(INOUT) :: matrix_new, eigenvectors_new
822 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_cfm_redistribute_end'
825#if defined(__parallel)
826 COMPLEX(KIND=dp) :: fake_local_data(1, 1)
827 INTEGER :: fake_descriptor(9), mepos_old, n
831 CALL timeset(routinen, handle)
833#if defined(__parallel)
836 IF (
ASSOCIATED(work_redistribute%group_distribution))
THEN
837 n = matrix%matrix_struct%nrow_global
838 para_env => matrix%matrix_struct%para_env
839 mepos_old = para_env%mepos
841 IF (work_redistribute%group_distribution(mepos_old) == 0)
THEN
843 CALL pzgemr2d(n, n, eigenvectors_new%local_data(1, 1), 1, 1, eigenvectors_new%matrix_struct%descriptor, &
844 eigenvectors%local_data(1, 1), 1, 1, eigenvectors%matrix_struct%descriptor, &
845 eigenvectors%matrix_struct%context)
853 CALL pzgemr2d(n, n, fake_local_data(1, 1), 1, 1, fake_descriptor, &
854 eigenvectors%local_data(1, 1), 1, 1, eigenvectors%matrix_struct%descriptor, &
855 eigenvectors%matrix_struct%context)
858 CALL cp_fm_redistribute_work_finalize(work_redistribute%group_distribution(mepos_old) == 0)
861 CALL para_env%bcast(eig, 0)
867 mark_used(eigenvectors)
869 mark_used(matrix_new)
870 mark_used(eigenvectors_new)
871 cpabort(
"Routine called in non-parallel case.")
874 CALL timestop(handle)
static GRID_HOST_DEVICE int modulo(int a, int m)
Equivalent of Fortran's MODULO, which always return a positive number. https://gcc....
methods related to the blacs parallel environment
subroutine, public cp_blacs_env_release(blacs_env)
releases the given blacs_env
subroutine, public cp_blacs_env_create(blacs_env, para_env, blacs_grid_layout, blacs_repeatable, row_major, grid_2d)
allocates and initializes a type that represent a blacs context
Represents a complex full matrix distributed on many processors.
subroutine, public cp_cfm_release(matrix)
Releases a full matrix.
subroutine, public cp_cfm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
Creates a new full matrix with the given structure.
subroutine, public cp_cfm_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, matrix_struct, para_env)
Returns information about a full matrix.
Auxiliary tools to redistribute cp_fm_type and cp_cfm_type matrices before and after diagonalization....
subroutine, public cp_fm_redistribute_end(matrix, eigenvectors, eig, matrix_new, eigenvectors_new)
Redistributes eigenvectors and eigenvalues back to the original communicator group.
subroutine, public cp_cfm_redistribute_start(matrix, eigenvectors, matrix_new, eigenvectors_new, caller_is_elpa, redist_info)
Determines the optimal number of CPUs for matrix diagonalization and redistributes the input matrices...
subroutine, public cp_cfm_redistribute_end(matrix, eigenvectors, eig, matrix_new, eigenvectors_new)
Redistributes eigenvectors and eigenvalues back to the original communicator group.
subroutine, public cp_fm_redistribute_start(matrix, eigenvectors, matrix_new, eigenvectors_new, caller_is_elpa, redist_info)
Determines the optimal number of CPUs for matrix diagonalization and redistributes the input matrices...
subroutine, public cp_fm_redistribute_init(a, x, should_print, elpa_force_redistribute)
Initializes the parameters that determine how to calculate the optimal number of CPUs for diagonalizi...
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_get(fmstruct, para_env, context, descriptor, ncol_block, nrow_block, nrow_global, ncol_global, first_p_pos, row_indices, col_indices, nrow_local, ncol_local, nrow_locals, ncol_locals, local_leading_dimension)
returns the values of various attributes of the matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
subroutine, public cp_fm_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, nrow_locals, ncol_locals, matrix_struct, para_env)
returns all kind of information about the full matrix
subroutine, public cp_fm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
creates a new full matrix with the given structure
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
Defines the basic variable types.
integer, parameter, public dp
Collection of simple mathematical functions and subroutines.
elemental integer function, public gcd(a, b)
computes the greatest common divisor of two number
Interface to the message passing library MPI.
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
Represent a complex full matrix.
keeps the information about the structure of a full matrix
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment