Skip to content

Commit

Permalink
Added fix for Sandia-OpenSHMEM#814; Added transport layer put-signal …
Browse files Browse the repository at this point in the history
…implementation for portals4

Signed-off-by: Md <[email protected]>
  • Loading branch information
wrrobin committed Dec 11, 2018
1 parent 352ba85 commit 949959e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/transport_portals4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}


Expand Down
8 changes: 8 additions & 0 deletions test/shmemx/put_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 4 additions & 0 deletions test/shmemx/put_signal_nbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down

0 comments on commit 949959e

Please sign in to comment.