upc_memget

Date:

04-27-2016

NAME

upc_memget, upc_memget_nb, upc_memget_nbi - Copies block of memory from a shared memory area to a private memory area

SYNOPSIS

#include <upc.h>

void upc_memget(void * restrict dst, shared const void * restrict src, size_t n);

#include <upc_nb.h>

upc_handle_t upc_memget_nb(void * restrict dst, shared const void * restrict src, size_t n);
void upc_memget_nbi(void * restrict dst, shared const void *restrict src, size_t n);

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

The upc_memget family of functions copy n characters from a shared object having affinity with one thread to a private memory area on the calling thread. If copying takes place between objects that overlap, the behavior is undefined.

The upc_memget family of functions treat the src 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 one shared array with this type (the src array) to a local array (the dst array) declared with the type:

char[n]

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

The upc_memget_nb and upc_memget_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

The upc_memget_nb function returns a handle suitable for use with the upc_sync and upc_test functions, which may be used to guarantee completion at some point before the next fence. Use of the upc_sync and upc_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_memput(3c), upc_memset(3c), upc_sync(3c)