From d55babfdb4a215389a8f0075108ac84a318edf7e Mon Sep 17 00:00:00 2001 From: meng004 Date: Mon, 6 Jul 2026 15:04:54 +0000 Subject: [PATCH] mpi: fix local_size_many_transposed when yblock == n[1] (#174) The transposed output distribution was gated by a strict yblock < n[1], so passing yblock == n[1] fell through to the non-transposed fallback and left dims[1].ob = n[1]. That made rank 1 non-idle and report local_ny = n1 instead of 0, disagreeing with fftw_mpi_plan_many_transpose which distributes n1 by yblock unconditionally. Use <= so the boundary case takes the transposed distribution the planner already produces. --- mpi/api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mpi/api.c b/mpi/api.c index 3d86e76a8..1f357f2ee 100644 --- a/mpi/api.c +++ b/mpi/api.c @@ -374,10 +374,10 @@ ptrdiff_t XM(local_size_many_transposed)(int rnk, const ptrdiff_t *n, local = (ptrdiff_t *) MALLOC(sizeof(ptrdiff_t) * rnk * 4, TENSORS); /* default 1d block distribution, with transposed output - if yblock < n[1] */ + if yblock <= n[1] */ dims[0].ib = xblock; if (rnk > 1) { - if (yblock < n[1]) + if (yblock <= n[1]) dims[1].ob = yblock; else dims[0].ob = xblock;