From a6f36aee74ef7d90aa7fe42d496730808ae0488fd36305a84642ddaed5bbde61 Mon Sep 17 00:00:00 2001 From: Nicolas Morey Date: Tue, 27 May 2025 09:07:36 +0000 Subject: [PATCH 1/2] - Fix bad git_ver appearing in VERSION - Add disable-atomic-cas-128b-on-s390x.patch to fix a 128b CAS issue on s390x (bsc#1243680) OBS-URL: https://build.opensuse.org/package/show/science:HPC/openmpi5?expand=0&rev=30 --- disable-atomic-cas-128b-on-s390x.patch | 22 ++++++++++++++++++++++ openmpi5.changes | 7 +++++++ openmpi5.spec | 3 ++- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 disable-atomic-cas-128b-on-s390x.patch diff --git a/disable-atomic-cas-128b-on-s390x.patch b/disable-atomic-cas-128b-on-s390x.patch new file mode 100644 index 0000000..0eddc89 --- /dev/null +++ b/disable-atomic-cas-128b-on-s390x.patch @@ -0,0 +1,22 @@ +commit 3cb6bc694b11fe1b82ad9cc0c637ccabb119860f +Author: Nicolas Morey +Date: Mon May 26 22:00:07 2025 +0200 + + disable atomic cas 128b on s390x + + Signed-off-by: Nicolas Morey + +diff --git config/opal_config_asm.m4 config/opal_config_asm.m4 +index 1a458e748f11..b04cfdba2df1 100644 +--- config/opal_config_asm.m4 ++++ config/opal_config_asm.m4 +@@ -70,6 +70,9 @@ static void test2(void) + + int main(int argc, char** argv) + { ++#if defined(__s390__) ++ exit(1); ++#endif + test1(); + test2(); + return 0; diff --git a/openmpi5.changes b/openmpi5.changes index 33083e8..ca6483f 100644 --- a/openmpi5.changes +++ b/openmpi5.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon May 26 15:52:53 UTC 2025 - Nicolas Morey + +- Fix bad git_ver appearing in VERSION +- Add disable-atomic-cas-128b-on-s390x.patch to fix a 128b CAS issue on + s390x (bsc#1243680) + ------------------------------------------------------------------- Tue Apr 15 11:18:46 UTC 2025 - Nicolas Morey diff --git a/openmpi5.spec b/openmpi5.spec index 86526a8..590028c 100644 --- a/openmpi5.spec +++ b/openmpi5.spec @@ -88,6 +88,7 @@ Source5: mpivars.csh Patch1: romio341-backport-fixes-from-mpich.patch Patch2: mtl-ofi-fix-missing-definition-of-container_of.patch Patch3: Fix-type-mismatch-error.patch +Patch4: disable-atomic-cas-128b-on-s390x.patch Provides: mpi BuildRoot: %{_tmppath}/%{name}-%{version}-build # Exclude 32b archs @@ -310,7 +311,7 @@ echo FLAVOR %{flavor} %autosetup -p0 -n openmpi-%{version} # Live patch the VERSION file -sed -i -e 's/^greek=.*$/greek=%{git_ver}/' -e 's/^repo_rev=.*$/repo_rev=%{version}%{git_ver}/' \ +sed -i -e 's/^greek=.*$/greek=/' -e 's/^repo_rev=.*$/repo_rev=%{version}/' \ -e 's/^date=.*$/date="OpenMPI %{version} Distribution for SUSE"/' VERSION ############################################################################# From fc3217c927feefa02fa226f829f5e8312d2102fa20dbb433c5ba607d45a5a724 Mon Sep 17 00:00:00 2001 From: Nicolas Morey Date: Thu, 29 May 2025 12:20:25 +0000 Subject: [PATCH 2/2] - Add Force-alignment-of-opal_atomic_int128_t-to-be-16B.patch to fix a 128b CAS issue on OBS-URL: https://build.opensuse.org/package/show/science:HPC/openmpi5?expand=0&rev=31 --- ...nt-of-opal_atomic_int128_t-to-be-16B.patch | 28 +++++++++++++++++++ disable-atomic-cas-128b-on-s390x.patch | 22 --------------- openmpi5.changes | 2 +- openmpi5.spec | 2 +- 4 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 Force-alignment-of-opal_atomic_int128_t-to-be-16B.patch delete mode 100644 disable-atomic-cas-128b-on-s390x.patch diff --git a/Force-alignment-of-opal_atomic_int128_t-to-be-16B.patch b/Force-alignment-of-opal_atomic_int128_t-to-be-16B.patch new file mode 100644 index 0000000..a34eeb6 --- /dev/null +++ b/Force-alignment-of-opal_atomic_int128_t-to-be-16B.patch @@ -0,0 +1,28 @@ +commit d9a5f9d9db092cc5b4d8fd563a834183b2e9b301 +Author: Joseph Schuchart +Date: Wed May 28 10:11:58 2025 -0400 + + Force alignment of opal_atomic_int128_t to be 16B + + Some architectures will align 128bit integer on 8B but require 16B alignment + for 128bit CAS instructions and otherwise fall back to a lock-based + atomicity model. By forcing 16bit alignment we can ensure that the variables + are properly aligned and the fall-back is not triggered. + + Thanks to Ulrich Weigand for the analysis and proposed fix in https://github.com/open-mpi/ompi/issues/10988#issuecomment-2913388506. + + Signed-off-by: Joseph Schuchart + +diff --git opal/include/opal_stdatomic.h opal/include/opal_stdatomic.h +index 354375512088..f7dd8353d3b6 100644 +--- opal/include/opal_stdatomic.h ++++ opal/include/opal_stdatomic.h +@@ -72,7 +72,7 @@ typedef _Atomic opal_int128_t opal_atomic_int128_t; + + # else + +-typedef volatile opal_int128_t opal_atomic_int128_t; ++typedef volatile opal_int128_t opal_atomic_int128_t __opal_attribute_aligned__(16); + + # endif + diff --git a/disable-atomic-cas-128b-on-s390x.patch b/disable-atomic-cas-128b-on-s390x.patch deleted file mode 100644 index 0eddc89..0000000 --- a/disable-atomic-cas-128b-on-s390x.patch +++ /dev/null @@ -1,22 +0,0 @@ -commit 3cb6bc694b11fe1b82ad9cc0c637ccabb119860f -Author: Nicolas Morey -Date: Mon May 26 22:00:07 2025 +0200 - - disable atomic cas 128b on s390x - - Signed-off-by: Nicolas Morey - -diff --git config/opal_config_asm.m4 config/opal_config_asm.m4 -index 1a458e748f11..b04cfdba2df1 100644 ---- config/opal_config_asm.m4 -+++ config/opal_config_asm.m4 -@@ -70,6 +70,9 @@ static void test2(void) - - int main(int argc, char** argv) - { -+#if defined(__s390__) -+ exit(1); -+#endif - test1(); - test2(); - return 0; diff --git a/openmpi5.changes b/openmpi5.changes index ca6483f..b577b62 100644 --- a/openmpi5.changes +++ b/openmpi5.changes @@ -2,7 +2,7 @@ Mon May 26 15:52:53 UTC 2025 - Nicolas Morey - Fix bad git_ver appearing in VERSION -- Add disable-atomic-cas-128b-on-s390x.patch to fix a 128b CAS issue on +- Add Force-alignment-of-opal_atomic_int128_t-to-be-16B.patch to fix a 128b CAS issue on s390x (bsc#1243680) ------------------------------------------------------------------- diff --git a/openmpi5.spec b/openmpi5.spec index 590028c..5a12211 100644 --- a/openmpi5.spec +++ b/openmpi5.spec @@ -88,7 +88,7 @@ Source5: mpivars.csh Patch1: romio341-backport-fixes-from-mpich.patch Patch2: mtl-ofi-fix-missing-definition-of-container_of.patch Patch3: Fix-type-mismatch-error.patch -Patch4: disable-atomic-cas-128b-on-s390x.patch +Patch4: Force-alignment-of-opal_atomic_int128_t-to-be-16B.patch Provides: mpi BuildRoot: %{_tmppath}/%{name}-%{version}-build # Exclude 32b archs