upc_affinitysize

Date:

09-23-2013

NAME

upc_affinitysize - Calculates the size of the local portion of data in a shared object

SYNOPSIS

#include <upc.h>

size_t upc_affinitysize(size_t totalsize, size_t nbytes, size_t threadid);

IMPLEMENTATION

Cray Linux Environment (CLE)

DESCRIPTION

The upc_affinitysize function calculates the exact size of the local portion of the data in a shared object with affinity to a given thread. Where:

totalsize

The total size of the allocation in bytes

nbytes

The number of bytes in a block

threadid

The thread whose affinitysize is to be evaluated

In the case of a dynamically allocated shared object, the totalsize argument must be nblocks * nbytes, where nblocks and nbytes are exactly as passed to upc_global_alloc or upc_all_alloc when the object was allocated.

In the case of a statically allocated shared object with declaration:

shared [b] t d[s];

the totalsize argument must be s * sizeof(t) and the nbytes argument must be b * sizeof(t). If block size is unspecified, it must be 1.

threadid must be a value within the range 0…(THREADS-1).

SEE ALSO

upc_addrfield(3c), upc_phaseof(3c), upc_resetphase(3c), upc_threadof(3c)