From 5489bc081f4417fb77c583d5f5b2cbf1bb83d1f0 Mon Sep 17 00:00:00 2001 From: Tomislav Janjusic Date: Thu, 19 Dec 2019 21:15:41 +0200 Subject: [PATCH] oshmem/extended: Fix shmem_atomic_set for float and double. Co-authored with: Artem Polyakov Signed-off-by: Tomislav Janjusic (cherry picked from commit 2d8f9b1d09d0dd8dee9e81f0ea4eaac6f979621c) --- oshmem/shmem/c/shmem_set.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oshmem/shmem/c/shmem_set.c b/oshmem/shmem/c/shmem_set.c index 5091882714..30fef842cb 100644 --- a/oshmem/shmem/c/shmem_set.c +++ b/oshmem/shmem/c/shmem_set.c @@ -27,17 +27,18 @@ int rc = OSHMEM_SUCCESS; \ size_t size = 0; \ type out_value; \ - \ + uint64_t value_tmp; \ RUNTIME_CHECK_INIT(); \ RUNTIME_CHECK_PE(pe); \ RUNTIME_CHECK_ADDR(target); \ \ size = sizeof(out_value); \ + memcpy(&value_tmp, &value, size); \ rc = MCA_ATOMIC_CALL(swap( \ ctx, \ (void*)target, \ (void*)&out_value, \ - value, \ + value_tmp, \ size, \ pe)); \ RUNTIME_CHECK_RC(rc); \