From 45ea8733593f8d4003fee9a1dfaec51be1dd14ec Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 13 Feb 2023 10:28:35 -0500 Subject: [PATCH] Backport PR#6374 to fix MPI_allgatherv fastpath error (cherry picked from commit 2400e5803f7ea3ef5fa4034ac90f2c6361f1257d) --- 6374.patch | 38 ++++++++++++++++++++++++++++++++++++++ mpich.spec | 2 ++ 2 files changed, 40 insertions(+) create mode 100644 6374.patch diff --git a/6374.patch b/6374.patch new file mode 100644 index 0000000..9471ae6 --- /dev/null +++ b/6374.patch @@ -0,0 +1,38 @@ +From 2b8c5c7dc4974fc471b446e6cc939936aa14fd8f Mon Sep 17 00:00:00 2001 +From: Hui Zhou +Date: Sat, 21 Jan 2023 10:35:32 -0600 +Subject: [PATCH] coll: fix allgatherv early return case + +The localcopy omitted considering displs. +--- + src/binding/c/coll_api.txt | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/binding/c/coll_api.txt b/src/binding/c/coll_api.txt +index 55be70d093e..d288272e2f3 100644 +--- a/src/binding/c/coll_api.txt ++++ b/src/binding/c/coll_api.txt +@@ -57,7 +57,10 @@ MPI_Allgatherv: + { -- early_return -- + if (comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM && MPIR_Comm_size(comm_ptr) == 1) { + if (sendbuf != MPI_IN_PLACE) { +- MPIR_Localcopy(sendbuf, sendcount, sendtype, recvbuf, recvcounts[0], recvtype); ++ MPI_Aint recvtype_extent; ++ MPIR_Datatype_get_extent_macro(recvtype, recvtype_extent); ++ MPIR_Localcopy(sendbuf, sendcount, sendtype, ++ (char *) recvbuf + displs[0] * recvtype_extent, recvcounts[0], recvtype); + } + goto fn_exit; + } +@@ -188,7 +191,10 @@ MPI_Iallgatherv: + { -- early_return -- + if (comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM && MPIR_Comm_size(comm_ptr) == 1) { + if (sendbuf != MPI_IN_PLACE) { +- MPIR_Localcopy(sendbuf, sendcount, sendtype, recvbuf, recvcounts[0], recvtype); ++ MPI_Aint recvtype_extent; ++ MPIR_Datatype_get_extent_macro(recvtype, recvtype_extent); ++ MPIR_Localcopy(sendbuf, sendcount, sendtype, ++ (char *) recvbuf + displs[0] * recvtype_extent, recvcounts[0], recvtype); + } + MPIR_Request *request_ptr = MPIR_Request_create_complete(MPIR_REQUEST_KIND__COLL); + *request = request_ptr->handle; diff --git a/mpich.spec b/mpich.spec index bab838a..25f413f 100644 --- a/mpich.spec +++ b/mpich.spec @@ -15,6 +15,8 @@ Patch: 0002-pkgconf-also-drop-rpath-flags-from-pkgconf-file.patch Patch: 0003-Drop-build-flags-e.g.-specs.-and-lto-from-mpi-wrappe.patch Patch: 0004-Make-mpich.module-useful.patch # TODO: submit ^ upstream +# https://github.com/pmodels/mpich/pull/6374 +Patch: 6374.patch Patch: mpich-configure-max_align_t.patch Patch: mpich-aclocal_cc-implicit-int.patch