From 4939a6737dc86362b05801bdfa7db8d758386707 Mon Sep 17 00:00:00 2001 From: Hans Pabst Date: Tue, 10 Dec 2024 15:50:45 +0100 Subject: [PATCH] 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 --- src/fm/cp_fm_struct.F | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/fm/cp_fm_struct.F b/src/fm/cp_fm_struct.F index c6c1a27275..10bfa30afd 100644 --- a/src/fm/cp_fm_struct.F +++ b/src/fm/cp_fm_struct.F @@ -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