Eigenvalue SoLvers for Petaflop-Applications (ELPA) 2025.01.002
Loading...
Searching...
No Matches
elpa_pxgemm_helpers_template.F90
Go to the documentation of this file.
1#if 0
2! This file is part of ELPA.
3!
4! The ELPA library was originally created by the ELPA consortium,
5! consisting of the following organizations:
6!
7! - Max Planck Computing and Data Facility (MPCDF), formerly known as
8! Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
9! - Bergische Universität Wuppertal, Lehrstuhl für angewandte
10! Informatik,
11! - Technische Universität München, Lehrstuhl für Informatik mit
12! Schwerpunkt Wissenschaftliches Rechnen ,
13! - Fritz-Haber-Institut, Berlin, Abt. Theorie,
14! - Max-Plack-Institut für Mathematik in den Naturwissenschaften,
15! Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
16! and
17! - IBM Deutschland GmbH
18!
19!
20! More information can be found here:
21! http://elpa.mpcdf.mpg.de/
22!
23! ELPA is free software: you can redistribute it and/or modify
24! it under the terms of the version 3 of the license of the
25! GNU Lesser General Public License as published by the Free
26! Software Foundation.
27!
28! ELPA is distributed in the hope that it will be useful,
29! but WITHOUT ANY WARRANTY; without even the implied warranty of
30! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31! GNU Lesser General Public License for more details.
32!
33! You should have received a copy of the GNU Lesser General Public License
34! along with ELPA. If not, see <http://www.gnu.org/licenses/>
35!
36! ELPA reflects a substantial effort on the part of the original
37! ELPA consortium, and we ask you to respect the spirit of the
38! license that we chose: i.e., please contribute any changes you
39! may have back to the original ELPA library distribution, and keep
40! any derivatives of ELPA under the same license that we chose for
41! the original distribution, the GNU Lesser General Public License.
42!
43! Author: Peter Karpov, MPCDF
44#endif
45
46#include "../general/error_checking.inc"
47
48
49! aux_mat_full:
50
51! if (a_transposed) then
52! allocate(aux_a_full(nblk_mult, nblk_mult), stat=istat, errmsg=errorMessage)
53! allocate(aux_b_full(nblk_mult, nblk_mult_max*(np_dirs_fine/np_dirs_t)), stat=istat, errmsg=errorMessage)
54
55! else if (b_transposed) then
56! allocate(aux_a_full(nblk_mult_max*(np_dirs_fine/np_dirs_t), nblk_mult), stat=istat, errmsg=errorMessage)
57! allocate(aux_b_full(nblk_mult, nblk_mult), stat=istat, errmsg=errorMessage)
58
59subroutine set_zeros_in_unused_block_part_&
60 &math_datatype&
61 &_&
62 &precision&
63 (aux_mat_full, nblk, nblk_rows_cut, nblk_cols_cut, &
64 i_block_loc_fine, j_block_loc_fine, shift_i, shift_j)
65
66 use, intrinsic :: iso_c_binding
67 use precision
68 implicit none
69#include "../../src/general/precision_kinds.F90"
70
71 math_datatype(kind=rck), pointer, contiguous :: aux_mat_full(:,:)
72 integer(kind=ik) :: nblk, nblk_rows_cut, nblk_cols_cut
73 integer(kind=ik) :: i_block_loc_fine, j_block_loc_fine
74 integer(kind=ik), value :: shift_i, shift_j
75
76 if (nblk_rows_cut<nblk .and. nblk_cols_cut>0) then ! for negative nblk_rows_cut we nullify the whole block (it's locally absent)
77 aux_mat_full(1+max(nblk_rows_cut,0) + i_block_loc_fine*nblk + shift_i : &
78 nblk + i_block_loc_fine*nblk + shift_i, &
79 1 + j_block_loc_fine*nblk + shift_j : &
80 nblk_cols_cut + j_block_loc_fine*nblk + shift_j) = 0
81 endif
82
83 if (nblk_cols_cut<nblk .and. nblk_rows_cut>0) then
84 aux_mat_full(1 + i_block_loc_fine*nblk + shift_i : &
85 nblk_rows_cut + i_block_loc_fine*nblk + shift_i, &
86 1+max(nblk_cols_cut,0) + j_block_loc_fine*nblk + shift_j : &
87 nblk + j_block_loc_fine*nblk + shift_j) = 0
88 endif
89
90 if (nblk_rows_cut<nblk .and. nblk_cols_cut<nblk) then
91 aux_mat_full(1+max(nblk_rows_cut,0) + i_block_loc_fine*nblk + shift_i: &
92 nblk + i_block_loc_fine*nblk + shift_i, &
93 1+max(nblk_cols_cut,0) + j_block_loc_fine*nblk + shift_j : &
94 nblk + j_block_loc_fine*nblk + shift_j) = 0
95 endif
96
97end subroutine
98