From 949959e495b8f222ba6b051015a2649c08d32f46 Mon Sep 17 00:00:00 2001 From: Md Date: Tue, 11 Dec 2018 11:05:35 -0600 Subject: [PATCH] Added fix for #814; Added transport layer put-signal implementation for portals4 Signed-off-by: Md --- src/transport_portals4.h | 18 ++++++++++++++++++ test/shmemx/put_signal.c | 8 ++++++++ test/shmemx/put_signal_nbi.c | 4 ++++ 3 files changed, 30 insertions(+) diff --git a/src/transport_portals4.h b/src/transport_portals4.h index a13db3633..49a5588a8 100644 --- a/src/transport_portals4.h +++ b/src/transport_portals4.h @@ -647,6 +647,24 @@ static inline void shmem_transport_put_signal(shmem_transport_ctx_t* ctx, void *target, const void *source, size_t len, uint64_t *sig_addr, uint64_t signal, int pe, long *completion) { + if ((*completion) != -1) { +#ifdef ENABLE_REMOTE_VIRTUAL_ADDRESSING + shmem_transport_portals4_put_nb_internal(ctx, target, source, len, pe, + completion, + shmem_transport_portals4_pt, + -1); +#else + shmem_transport_portals4_put_nb_internal(ctx, target, source, len, pe, + completion, + shmem_transport_portals4_data_pt, + shmem_transport_portals4_heap_pt); +#endif + shmem_transport_put_scalar(ctx, sig_addr, &signal, sizeof(uint64_t), pe); + } else { + shmem_transport_put_nbi(ctx, target, source, len, pe); + shmem_transport_fence(ctx); + shmem_transport_put_scalar(ctx, sig_addr, &signal, sizeof(uint64_t), pe); + } } diff --git a/test/shmemx/put_signal.c b/test/shmemx/put_signal.c index 0655386f8..8c4791e8c 100644 --- a/test/shmemx/put_signal.c +++ b/test/shmemx/put_signal.c @@ -65,9 +65,17 @@ int main(int argc, char *argv[]) if (me == 0) { shmemx_long_put_signal(target, source, MSG_SZ, &sig_addr, 1, dest); +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L shmem_wait_until(&sig_addr, SHMEM_CMP_EQ, 1); +#else + shmem_uint64_wait_until(&sig_addr, SHMEM_CMP_EQ, 1); +#endif } else { +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L shmem_wait_until(&sig_addr, SHMEM_CMP_EQ, 1); +#else + shmem_uint64_wait_until(&sig_addr, SHMEM_CMP_EQ, 1); +#endif shmemx_long_put_signal(target, target, MSG_SZ, &sig_addr, 1, dest); } diff --git a/test/shmemx/put_signal_nbi.c b/test/shmemx/put_signal_nbi.c index 6d9abc1e7..4d3b94412 100644 --- a/test/shmemx/put_signal_nbi.c +++ b/test/shmemx/put_signal_nbi.c @@ -67,7 +67,11 @@ int main(int argc, char *argv[]) } } +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L shmem_wait_until(&sig_addr, SHMEM_CMP_EQ, 1); +#else + shmem_uint64_wait_until(&sig_addr, SHMEM_CMP_EQ, 1); +#endif for (i = 0; i < MSG_SZ; i++) { if (target[i] != source[i]) {