SHA256
1
0
forked from pool/mvapich2

Accepting request 1124846 from home:NMorey:branches:science:HPC

- Add mvapich2-openpa-add-memory-barriers.patch to fix testsuite issue
  on pcc64 (bsc#1216610, bsc#1216612)

OBS-URL: https://build.opensuse.org/request/show/1124846
OBS-URL: https://build.opensuse.org/package/show/science:HPC/mvapich2?expand=0&rev=97
This commit is contained in:
Nicolas Morey 2023-11-10 10:35:55 +00:00 committed by Git OBS Bridge
parent 2d5b49ceae
commit e7c554906c
3 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,94 @@
commit 68c4106b2a8d8fdb9ba4e2bab90e90e3392b6bbd
Author: Nicolas Morey <nmorey@suse.com>
Date: Thu Oct 26 12:39:20 2023 +0200
mvapich2: openpa: add memory barriers
Backport from openPA:
commit 28d602b620b5d7ec8ca1a7f3ad8ab27d439b1751
Author: Neil Fortner <nfortne2@hdfgroup.org>
Date: Wed Dec 19 13:14:57 2012 -0600
Add more memory barriers to LL/SC ABA tests. This should fix the recent errors
on POWER7.
Reviewed by goodell.
Signed-off-by: Nicolas Morey <nmorey@suse.com>
diff --git src/openpa/test/test_primitives.c src/openpa/test/test_primitives.c
index a83b95e00578..4533c643d581 100644
--- src/openpa/test/test_primitives.c
+++ src/openpa/test/test_primitives.c
@@ -3783,12 +3783,18 @@ static int threaded_llsc_int_aba_helper_0(llsc_int_aba_t *udata)
nerrors++;
} /* end if */
+ /* Make sure shared_val is initialized before passing point 0 */
+ OPA_write_barrier();
+
/* Point 0 */
OPA_store_int(&udata->pass_point_0, 1);
/* Wait until thread 1 passes point 1 */
while(!OPA_load_int(&udata->pass_point_1));
+ /* Make sure that change_val is loaded after passing point 1 */
+ OPA_read_barrier();
+
/* Store conditional 1 to the shared value */
if(OPA_SC_int(&udata->shared_val, 1)) {
/* SC succeeded, make sure that the shared value was not changed by
@@ -3870,12 +3876,12 @@ static void *threaded_llsc_int_aba_helper_1(void *_udata)
* of this test */
OPA_store_int(&udata->shared_val, 1);
OPA_store_int(&udata->shared_val, 0);
-
- /* Write barrier to make sure the shared value was actually updated
- * before we mark point 1 as passed */
- OPA_write_barrier();
} /* end if */
+ /* Write barrier to make sure the shared_val (if appropriate) and
+ * change_val are actually updated before we mark point 1 as passed */
+ OPA_write_barrier();
+
/* Point 1 */
OPA_store_int(&udata->pass_point_1, 1);
@@ -4012,12 +4018,18 @@ static int threaded_llsc_ptr_aba_helper_0(llsc_ptr_aba_t *udata)
nerrors++;
} /* end if */
+ /* Make sure shared_val is initialized before passing point 0 */
+ OPA_write_barrier();
+
/* Point 0 */
OPA_store_int(&udata->pass_point_0, 1);
/* Wait until thread 1 passes point 1 */
while(!OPA_load_int(&udata->pass_point_1));
+ /* Make sure that change_val is loaded after passing point 1 */
+ OPA_read_barrier();
+
/* Store conditional 1 to the shared value */
if(OPA_SC_ptr(&udata->shared_val, (void *) ((int *) 0 + 1))) {
/* SC succeeded, make sure that the shared value was not changed by
@@ -4099,12 +4111,12 @@ static void *threaded_llsc_ptr_aba_helper_1(void *_udata)
* of this test */
OPA_store_ptr(&udata->shared_val, (void *) ((int *) 0 + 1));
OPA_store_ptr(&udata->shared_val, (void *) 0);
-
- /* Write barrier to make sure the shared value was actually updated
- * before we mark point 1 as passed */
- OPA_write_barrier();
} /* end if */
+ /* Write barrier to make sure the shared_val (if appropriate) and
+ * change_val are actually updated before we mark point 1 as passed */
+ OPA_write_barrier();
+
/* Point 1 */
OPA_store_int(&udata->pass_point_1, 1);

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Oct 26 10:42:07 UTC 2023 - Nicolas Morey <nicolas.morey@suse.com>
- Add mvapich2-openpa-add-memory-barriers.patch to fix testsuite issue
on pcc64 (bsc#1216610, bsc#1216612)
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Aug 7 16:57:40 UTC 2023 - Nicolas Morey <nicolas.morey@suse.com> Mon Aug 7 16:57:40 UTC 2023 - Nicolas Morey <nicolas.morey@suse.com>

View File

@ -214,6 +214,7 @@ Patch3: 0001-Drop-GCC-check.patch
Patch4: reproducible.patch Patch4: reproducible.patch
Patch5: pass-correct-size-to-snprintf.patch Patch5: pass-correct-size-to-snprintf.patch
Patch6: mvapich2-allow-building-with-external-hwloc.patch Patch6: mvapich2-allow-building-with-external-hwloc.patch
Patch7: mvapich2-openpa-add-memory-barriers.patch
## Armv7 specific patches ## Armv7 specific patches
# PATCH-FIX-UPSTREAM 0001-Drop-real128.patch (https://github.com/pmodels/mpich/issues/4005) # PATCH-FIX-UPSTREAM 0001-Drop-real128.patch (https://github.com/pmodels/mpich/issues/4005)
Patch50: 0001-Drop-real128.patch Patch50: 0001-Drop-real128.patch
@ -352,6 +353,7 @@ is based on MPICH2 and MVICH. This package contains the static libraries
%patch4 %patch4
%patch5 -p1 %patch5 -p1
%patch6 %patch6
%patch7
# Only apply these patches on Armv7 # Only apply these patches on Armv7
%ifarch armv7hl %ifarch armv7hl