upc_memcpy

Date:

04-27-2016

NAME

upc_memcpy, upc_memcpy_nb, upc_memcpy_nbi - Copy a block of memory from one shared memory area to another shared memory area

SYNOPSIS

#include <upc.h>

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

upc_handle_t upc_memcpy_nb(shared void * restrict dst, shared const void * restrict src, size_t n);
void upc_memcpy_nbi(shared void * restrict dst, shared const void * restrict src, size_t n);

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

The upc_memcpy family of functions copies n characters from a shared object having affinity with one thread to a shared object having affinity with the same or another thread. If copying takes place between objects that overlap, the behavior is undefined.

The functions treat the dst and src pointers as if each of them 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 another shared array with this type (the dst array).

The upc_memcpy() function does not return until the copy is complete.

The upc_memcpy_nb() and upc_memcpy_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.

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.

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

RETURN VALUE

upc_memcpy_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.

The upc_memcpy_nbi() function does not return a handle and is synchronized at the next fence.

SEE ALSO

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