upc_memput

Date:

04-27-2016

NAME

upc_memput, upc_memput_nb, memput_nbi - Copies a block of memory from the calling thread’s private memory area to a shared memory area

SYNOPSIS

#include <upc.h>

void upc_memput(shared void * restrict dst, const void * restrict src, size_t n);
#include <upc_nb.h>

upc_handle_t upc_memput_nb(shared void * restrict dst, const void * restrict src, size_t n);
void upc_memput_nbi(shared void * restrict dst, const void * restrict src, size_t n);

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

The upc_memput family of functions copy n characters from a private object on the calling thread, src, to a shared object with affinity to any single thread, dst. If copying takes place between objects that overlap, the behavior is undefined.

The functions treat the dst pointer as if it pointed to a shared memory space on a single thread and therefore had type:

shared [] char[n]

The effect is equivalent to copying the entire contents from a local array (the src array) declared with the type:

char[n]

to a shared array (dst).

The upc_memput function does not return until the copy is complete.

The _nb and _nbi functions return immediately after initiating the copy; the copy likely will not be complete upon return. The copy is guaranteed to have completed after the next fence.

If the contents of the src array are modified before the copy has completed, the behavior is undefined.

The _nb functions return a handle, but the _nbi functions do not. The handle can be used to synchronize the copy operation before the next fence, but if the user chooses not to use the handle, the copy will be automatically synchronized at the next fence. The _nbi functions may perform better than their _nb counterparts.

RETURN VALUE

upc_memput_nb function returns a handle which may be input to upc_sync and upc_test, which can be used to ensure completion at some point before the next fence. Use of the sync and test functions is optional; it is not an error to ignore the returned handle. The handle should be considered invalid after the next fence.

SEE ALSO

upc_memcpy(3c), upc_memget(3c), upc_memset(3c), upc_sync(3c)