upc_memset

Date:

09-23-2013

NAME

upc_memset, upc_memset_nb, upc_memset_nbi - Copies a value to a shared memory area

SYNOPSIS

#include <upc.h>

void upc_memset(shared void * restrict, int c, size_t n);
#include <upc_nb.h>

upc_handle_t upc_memset_nb(shared void * restrict, int c, size_t n);
void upc_memset_nbi(shared void * restrict, int c, size_t n);

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

The upc_memset function copies the value of c, converted to an unsigned char, to a shared memory object with affinity to any single thread. The number of bytes set is n.

The upc_memset function treats the 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 setting the entire contents of a shared array object with this type to the value c.

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

The upc_memset_nb() and upc_memset_nbi() functions return immediately; the operation likely will not be complete upon return. The operation 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 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.

SEE ALSO

upc_memcpy(3c), upc_memget(3c), upc_memput(3c)