15 INTEGER,
PARAMETER :: orders(2) = [509, 536]
16 INTEGER :: i, itest, n
17 INTEGER,
EXTERNAL :: numroc
23 matrix_struct%para_env => para_env
24 matrix_struct%nrow_block = 64
25 matrix_struct%ncol_block = 64
26 ALLOCATE (matrix_struct%nrow_locals(0:3), matrix_struct%ncol_locals(0:7))
28 DO itest = 1,
SIZE(orders)
30 matrix_struct%nrow_global = n
31 matrix_struct%ncol_global = n
33 matrix_struct%nrow_locals(i) = numroc(n, 64, i, 0, 4)
36 matrix_struct%ncol_locals(i) = numroc(n, 64, i, 0, 8)
39 IF (cp_fm_max_ncpu_non_zero_column(matrix_struct, 32, 64) /= 32)
THEN
40 error stop
"Valid original redistribution layout changed"
43 IF (cp_fm_max_ncpu_non_zero_column(matrix_struct, 20, 64) /= 18)
THEN
44 error stop
"Unsafe forced redistribution layout accepted"
46 IF (cp_fm_max_ncpu_non_zero_column(matrix_struct, 12, 64) /= 12)
THEN
47 error stop
"Safe redistribution heuristic target changed"
49 IF (cp_fm_max_ncpu_non_zero_column(matrix_struct, 8, 64) /= 8)
THEN
50 error stop
"Safe smaller redistribution target changed"
52 IF (cp_fm_max_ncpu_non_zero_column(matrix_struct, 20, 32) /= 20)
THEN
53 error stop
"Redistribution check ignored the final block size"
58 matrix_struct%nrow_global = 1
59 matrix_struct%ncol_global = 1
60 matrix_struct%nrow_locals = 0
61 matrix_struct%ncol_locals = 0
62 matrix_struct%nrow_locals(0) = 1
63 matrix_struct%ncol_locals(0) = 1
64 IF (cp_fm_max_ncpu_non_zero_column(matrix_struct, 32, 64) /= 1)
THEN
65 error stop
"Empty original redistribution layout was retained"
68 DEALLOCATE (matrix_struct%nrow_locals, matrix_struct%ncol_locals)
72 matrix_struct%nrow_global = 509
73 matrix_struct%ncol_global = 509
74 matrix_struct%nrow_block = 96
75 matrix_struct%ncol_block = 96
76 ALLOCATE (matrix_struct%nrow_locals(0:3), matrix_struct%ncol_locals(0:4))
78 matrix_struct%nrow_locals(i) = numroc(509, 96, i, 0, 4)
81 matrix_struct%ncol_locals(i) = numroc(509, 96, i, 0, 5)
83 IF (cp_fm_max_ncpu_non_zero_column(matrix_struct, 20, 64) /= 18)
THEN
84 error stop
"Block-size change skipped the target grid check"
86 DEALLOCATE (matrix_struct%nrow_locals, matrix_struct%ncol_locals)
90 matrix_struct%nrow_block = 64
91 matrix_struct%ncol_block = 64
92 ALLOCATE (matrix_struct%nrow_locals(0:1), matrix_struct%ncol_locals(0:15))
94 matrix_struct%nrow_locals(i) = numroc(509, 64, i, 0, 2)
97 matrix_struct%ncol_locals(i) = numroc(509, 64, i, 0, 16)
99 IF (cp_fm_max_ncpu_non_zero_column(matrix_struct, 32, 64) /= 24)
THEN
100 error stop
"Invalid original grid skipped mandatory redistribution"
102 DEALLOCATE (matrix_struct%nrow_locals, matrix_struct%ncol_locals)
program cp_fm_diag_utils_unittest
Auxiliary tools to redistribute cp_fm_type and cp_cfm_type matrices before and after diagonalization....
represent the structure of a full matrix
Interface to the message passing library MPI.
keeps the information about the structure of a full matrix
stores all the informations relevant to an mpi environment