Further adjusted block size for FM matrices to be multiple of VLEN (#3801)

- Attempts to delivers https://github.com/cp2k/cp2k/pull/3795#issuecomment-2520377292
This commit is contained in:
Hans Pabst 2024-12-10 15:50:45 +01:00 committed by GitHub
parent e7c81ba798
commit 4939a6737d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -206,12 +206,18 @@ CONTAINS
vlen = m_cpuid_vlen()
nmax_block = (fmstruct%nrow_global + fmstruct%context%num_pe(1) - 1)/ &
(fmstruct%context%num_pe(1))*fmstruct%context%num_pe(1)
IF (1 < vlen) nmax_block = nmax_block/vlen*vlen ! floor
IF (1 < vlen) THEN ! flooring not ceiling (OOB)
fmstruct%nrow_block = fmstruct%nrow_block/vlen*vlen
nmax_block = nmax_block/vlen*vlen
END IF
fmstruct%nrow_block = MAX(MIN(fmstruct%nrow_block, nmax_block), 1)
nmax_block = (fmstruct%ncol_global + fmstruct%context%num_pe(2) - 1)/ &
(fmstruct%context%num_pe(1))*fmstruct%context%num_pe(2)
IF (1 < vlen) nmax_block = nmax_block/vlen*vlen ! floor
IF (1 < vlen) THEN ! flooring not ceiling (OOB)
fmstruct%ncol_block = fmstruct%ncol_block/vlen*vlen
nmax_block = nmax_block/vlen*vlen
END IF
fmstruct%ncol_block = MAX(MIN(fmstruct%ncol_block, nmax_block), 1)
END IF