MPC_OpenSHMEM

Module MPC_OpenSHMEM

Summary

This module is a partial implementation of the OpenSHMEM specification. Its primary usecase is to explore the viability of a One-Sided Communications API over the new generation BXIv3 interconnects. Mainly, we want to have a lightweight RMA module within MPC.

Contents

  • include/ : Headers exported as standard interface

    • shmem.h: Standard public header containing the routines and constants of the library

    • pshmem.h: Standard profiling interface (used for redefinition of the shmem.h routines)

    • shmemx.h: Extension to the standard API (empty for now)

  • src/ : Module main source files

    • mpc_openshmem.c: Implementation of the profiling routines defined in pshmem.h

    • mpc_openshmem_elf: Definitions and implementation of the ELF parser to retrieve .bss and .data sections

    • mpc_openshmem_memory: Definitions and implementation of the stack allocator to manage the symmetric heap

    • mpc_openshmem_internal.h: Definitions of the common structures and routines

    • mpc_openshmem_pweak.h: Weak linkage of the standard API to the profiling one

Components

The following list of components is the minimal requirements to use this module as a backend of Kokkos Remote Spaces which we aimed to provide

  • [x] General Purpose

    • [x] Initialization and Finalization routines and constants

    • [x] Queries on the ranks (size, number…)

    • [x] Queries on the library (version, initialized…)

  • [x] Memory Management

    • [x] Allocation and liberation of symmetric heap memory routines

    • [x] Reallocation

  • [x] One-Sided Blocking Communications

    • [x] One-Sided Put

    • [x] One-Sided Get

  • [ ] One-Sided NON Blocking Communications

    • [ ] Non-blocking Put

    • [ ] Non-blocking Get

  • [x] Atomic communications

    • [x] Atomic Fetch

    • [x] Atomic Fetch + Op

    • [x] Atomic Op

    • [x] Atomic Set

    • [x] Atomic Swap

    • [x] Atomic Compare & Swap

    • [ ] Atomic bitwise operations

  • [x] Synchronization

    • [x] Global barrier

    • [x] Flush, Quiet

    • [ ] Fence

The unmarked items should be simple to implement but are not required by Kokkos Remote Spaces.

Standard API

group OpenSHMEM API

OpenSHMEM specification definitions.

Warning

The implementation of the specification is partial

OpenSHMEM thread support levels

static const int SHMEM_THREAD_SINGLE = 0

No support for multithreaded application is granted.

static const int SHMEM_THREAD_FUNNELED = 1024

Support for only one thread invoking OpenSHMEM API at a time is granted.

static const int SHMEM_THREAD_SERIALIZED = 2048

Support for non concurrent OpenSHMEM API calls is granted.

static const int SHMEM_THREAD_MULTIPLE = 4096

Full support for multithreading in OpenSHMEM calls.

OpenSHMEM library information

static const int SHMEM_MAJOR_VERSION = 1

Integer representing the major version of OpenSHMEM Specification in use.

static const int SHMEM_MINOR_VERSION = 6

Integer representing the minor version of OpenSHMEM Specification in use.

static const int SHMEM_MAX_NAME_LEN = 32

Integer representing the maximum length of SHMEM_VENDOR_STRING.

static const char SHMEM_VENDOR_STRING[] = "MPC"

String representing vendor defined information.

__attribute__((deprecated)) void start_pes()

Deprecated version of shmem_init.

@function shrealloc

@function shfree

@function shmalloc

@function _num_pes

@function _my_pe

Deprecated version of shmem_my_pe

Deprecated version of shmem_n_pes

Deprecated version of shmem_malloc

Deprecated version of shmem_free

OpenSHMEM defined Setup, Exit and Query routines.

Functions

void shmem_init(void)

Initialize the OpenSHMEM runtime.

int shmem_my_pe(void)

Query the rank of the local task.

Returns:

Rank of the local task (in the world context)

int shmem_n_pes(void)

Query the number of the tasks.

Returns:

Number of tasks (in the world context)

void shmem_query_initialized(int *initialized)

Query the initialization status of the library.

Parameters:
  • initialized[out] non-zero if the library is initialized. Zero othrewise.

void shmem_finalize(void)

Finalize the OpenSHMEM runtime.

void shmem_global_exit(int status)

Force terminate the entire program.

Any invocation of this routine must lead to the termination of all PEs. I/O are flushed and resources released accordingly to C/C++ requirements on program termination.

Parameters:
  • status – Exit status from the main program

void shmem_info_get_version(int *major, int *minor)

Query the OpenSHMEM specification version of the library.

Parameters:
  • major[out] Major version of the specification

  • minor[out] Minor version of the specification

void shmem_info_get_name(char *name)

Query the vendor name of the library.

Parameters:
  • name[out] Vendor name of the library

int shmem_init_thread(int requested, int *provided)

Initialize the OpenSHMEM runtime to guarantee a certain level of multithreading.

Parameters:
  • requested[in] Level of multithreading requested

  • provided[out] Level of multithreading actually provided by the runtime

Returns:

0 upon success, a non-zero value otherwise

OpenSHMEM defined memory management routines.

Functions

void *shmem_malloc(size_t size)

Allocate memory on the symmetric heap.

Parameters:
  • size[in] Size in Bytes of the memory region to allocate

Return values:
  • addr – Symmetric address to the allocated memory region

  • NULL – if the allocation failed

void shmem_free(void *ptr)

Free a previously allocated region on the symmetric heap.

Parameters:
  • ptr[in] Pointer to the symmetric memory region to free

void *shmem_realloc(void *ptr, size_t size)

Resize an allocation of symmetric memory.

Parameters:
  • ptr[in] Symmetric address of an object in the symmetric heap

  • size[in] The size, in Bytes, of a block to be allocated from the symmetric heap

Return values:
  • addr – Symmetric address to the resized memory region

  • NULL – if the allocation failed

void *shmem_calloc(size_t count, size_t size)

Allocate a zeroed block of symmetric memory.

Parameters:
  • count[in] The number of elements to allocate

  • size[in] The size in bytes of each element to allocate

Return values:
  • addr – Symmetric address to the resized memory region

  • NULL – if the allocation failed

Variables

size_t size

OpenSHMEM defined basic one-sided communications.

Defines

shmem_put(dest, src, nelems, pe) _Generic

(src,                         \

float *:

shmem_float_put

,                 \

double *:

shmem_double_put

,               \

long double *:

shmem_longdouble_put

,      \

char *:

shmem_char_put,                   \ signed char *: shmem_schar_put

,           \

short *:

shmem_short_put

,                 \

int *:

shmem_int_put

,                     \

long *:

shmem_long_put

,                   \

long long *:

shmem_longlong_put

,          \

unsigned char *:

shmem_uchar_put

,         \

unsigned short *:

shmem_ushort_put

,       \

unsigned int *:

shmem_uint_put

,           \

unsigned long *:

shmem_ulong_put

,         \

unsigned long long *:

shmem_ulonglong_put

\

)(dest, src,

nelems, pe)

OpenSHMEM put operation with multiple contigue data.

Note

Generic counterpart of the shmem_TYPE_put functions.

Parameters:
  • dest[in] Symmetric address in which the data is put

  • src[in] Local address from which the data is read

  • nelems[in] Number of elements of any supported type to send

  • pe[in] Unique identifier (rank) of the target

shmem_p(dest, value, pe) _Generic(value,                   \ float: shmem_float_p,                 \ double: shmem_double_p

,               \

long

double: shmem_longdouble_p,      \ char: shmem_char_p,                   \ signed char: shmem_schar_p,           \ short: shmem_short_p,                 \ int: shmem_int_p,                     \ long: shmem_long_p

,                   \

long

long: shmem_longlong_p

,          \

unsigned

char: shmem_uchar_p

,         \

unsigned

short: shmem_ushort_p

,       \

unsigned

int: shmem_uint_p

,           \

unsigned

long: shmem_ulong_p

,         \

unsigned long

long: shmem_ulonglong_p

\

)(dest,

value, pe)

OpenSHMEM put operation with a single data.

Note

Generic counterpart of the shmem_TYPE_p functions.

Parameters:
  • dest[in] Symmetric address in which the data is put

  • value[in] Local value to be send

  • pe[in] Unique identifier (rank) of the target

shmem_get(dest, src, nelems, pe) _Generic

(dest,                        \

float *:

shmem_float_get

,                 \

double *:

shmem_double_get

,               \

long double *:

shmem_longdouble_get

,      \

char *:

shmem_char_get,                   \ signed char *: shmem_schar_get

,           \

short *:

shmem_short_get

,                 \

int *:

shmem_int_get

,                     \

long *:

shmem_long_get

,                   \

long long *:

shmem_longlong_get

,          \

unsigned char *:

shmem_uchar_get

,         \

unsigned short *:

shmem_ushort_get

,       \

unsigned int *:

shmem_uint_get

,           \

unsigned long *:

shmem_ulong_get

,         \

unsigned long long *:

shmem_ulonglong_get

\

)(dest, src,

nelems, pe)

OpenSHMEM get operation with multiple contigue data.

Note

Generic counterpart of the shmem_TYPE_get functions.

Parameters:
  • dest[in] Local address in which the data is put

  • src[in] Symmetric address from which the data is read

  • nelems[in] Number of elements of any supported type to send

  • pe[in] Unique identifier (rank) of the target

shmem_g(src, pe) _Generic

(src,                       \

float *:

shmem_float_g

,                 \

double *:

shmem_double_g

,               \

long double *:

shmem_longdouble_g

,      \

char *:

shmem_char_g,                   \ signed char *: shmem_schar_g

,           \

short *:

shmem_short_g

,                 \

int *:

shmem_int_g

,                     \

long *:

shmem_long_g

,                   \

long long *:

shmem_longlong_g

,          \

unsigned char *:

shmem_uchar_g

,         \

unsigned short *:

shmem_ushort_g

,       \

unsigned int *:

shmem_uint_g

,           \

unsigned long *:

shmem_ulong_g

,         \

unsigned long long *:

shmem_ulonglong_g

\

)(src,

pe)

OpenSHMEM get operation with a single data.

Note

Generic counterpart of the shmem_TYPE_g functions.

Parameters:
  • src[in] Symmetric address from which the data read

  • pe[in] Unique identifier (rank) of the target

Returns:

data stored in #src on the rank pe

OpenSHMEM put-like defined communications.

shmem_TYPE_put

OpenSHMEM put operation with multiple contigue data

param dest:

[in] Symmetric address in which the data is put

param src:

[in] Local address from which the data is read

param nelems:

[in] Number of elements of type TYPE to send

param pe:

[in] Unique identifier (rank) of the target

void shmem_float_put(float *dest, const float *src, size_t nelems, int pe)
void shmem_double_put(double *dest, const double *src, size_t nelems, int pe)
void shmem_longdouble_put(long double *dest, const long double *src, size_t nelems, int pe)
void shmem_char_put(char *dest, const char *src, size_t nelems, int pe)
void shmem_schar_put(signed char *dest, const signed char *src, size_t nelems, int pe)
void shmem_short_put(short *dest, const short *src, size_t nelems, int pe)
void shmem_int_put(int *dest, const int *src, size_t nelems, int pe)
void shmem_long_put(long *dest, const long *src, size_t nelems, int pe)
void shmem_longlong_put(long long *dest, const long long *src, size_t nelems, int pe)
void shmem_uchar_put(unsigned char *dest, const unsigned char *src, size_t nelems, int pe)
void shmem_ushort_put(unsigned short *dest, const unsigned short *src, size_t nelems, int pe)
void shmem_uint_put(unsigned int *dest, const unsigned int *src, size_t nelems, int pe)
void shmem_ulong_put(unsigned long *dest, const unsigned long *src, size_t nelems, int pe)
void shmem_ulonglong_put(unsigned long long *dest, const unsigned long long *src, size_t nelems, int pe)
void shmem_int8_t_put(int8_t *dest, const int8_t *src, size_t nelems, int pe)
void shmem_uint8_t_put(uint8_t *dest, const uint8_t *src, size_t nelems, int pe)
void shmem_int16_t_put(int16_t *dest, const int16_t *src, size_t nelems, int pe)
void shmem_uint16_t_put(uint16_t *dest, const uint16_t *src, size_t nelems, int pe)
void shmem_int32_t_put(int32_t *dest, const int32_t *src, size_t nelems, int pe)
void shmem_uint32_t_put(uint32_t *dest, const uint32_t *src, size_t nelems, int pe)
void shmem_int64_t_put(int64_t *dest, const int64_t *src, size_t nelems, int pe)
void shmem_uint64_t_put(uint64_t *dest, const uint64_t *src, size_t nelems, int pe)
void shmem_size_t_put(size_t *dest, const size_t *src, size_t nelems, int pe)
void shmem_ptrdiff_t_put(ptrdiff_t *dest, const ptrdiff_t *src, size_t nelems, int pe)

shmem_TYPE_p

OpenSHMEM put operation with a single data

param dest:

[in] Symmetric address in which the data is put

param value:

[in] Local value to send

param pe:

[in] Unique identifier (rank) of the target

void shmem_float_p(float *dest, const float value, int pe)
void shmem_double_p(double *dest, const double value, int pe)
void shmem_longdouble_p(long double *dest, const long double value, int pe)
void shmem_char_p(char *dest, const char value, int pe)
void shmem_schar_p(signed char *dest, const signed char value, int pe)
void shmem_short_p(short *dest, const short value, int pe)
void shmem_int_p(int *dest, const int value, int pe)
void shmem_long_p(long *dest, const long value, int pe)
void shmem_longlong_p(long long *dest, const long long value, int pe)
void shmem_uchar_p(unsigned char *dest, const unsigned char value, int pe)
void shmem_ushort_p(unsigned short *dest, const unsigned short value, int pe)
void shmem_uint_p(unsigned int *dest, const unsigned int value, int pe)
void shmem_ulong_p(unsigned long *dest, const unsigned long value, int pe)
void shmem_ulonglong_p(unsigned long long *dest, const unsigned long long value, int pe)
void shmem_int8_t_p(int8_t *dest, const int8_t value, int pe)
void shmem_uint8_t_p(uint8_t *dest, const uint8_t value, int pe)
void shmem_int16_t_p(int16_t *dest, const int16_t value, int pe)
void shmem_uint16_t_p(uint16_t *dest, const uint16_t value, int pe)
void shmem_int32_t_p(int32_t *dest, const int32_t value, int pe)
void shmem_uint32_t_p(uint32_t *dest, const uint32_t value, int pe)
void shmem_int64_t_p(int64_t *dest, const int64_t value, int pe)
void shmem_uint64_t_p(uint64_t *dest, const uint64_t value, int pe)
void shmem_size_t_p(size_t *dest, const size_t value, int pe)
void shmem_ptrdiff_t_p(ptrdiff_t *dest, const ptrdiff_t value, int pe)

Functions

void shmem_putmem(void *dest, const void *source, size_t size, int pe)

OpenSHMEM put operation with a size in bytes instead of a count of typed objects.

Parameters:
  • dest[in] Symmetric address in which the data is put

  • source[in] Local address from which the data is read

  • size[in] Size in bytes to send

  • pe[in] Unique identifier (rank) of the target

OpenSHMEM get-like defined communications.

shmem_TYPE_get

OpenSHMEM get operation with multiple contigue data

param dest:

[in] Local address in which the data is put

param src:

[in] Symmetric address from which the data is read

param nelems:

[in] Number of elements of type TYPE to receive

param pe:

[in] Unique identifier (rank) of the target

void shmem_float_get(float *dest, const float *src, size_t nelems, int pe)
void shmem_double_get(double *dest, const double *src, size_t nelems, int pe)
void shmem_longdouble_get(long double *dest, const long double *src, size_t nelems, int pe)
void shmem_char_get(char *dest, const char *src, size_t nelems, int pe)
void shmem_schar_get(signed char *dest, const signed char *src, size_t nelems, int pe)
void shmem_short_get(short *dest, const short *src, size_t nelems, int pe)
void shmem_int_get(int *dest, const int *src, size_t nelems, int pe)
void shmem_long_get(long *dest, const long *src, size_t nelems, int pe)
void shmem_longlong_get(long long *dest, const long long *src, size_t nelems, int pe)
void shmem_uchar_get(unsigned char *dest, const unsigned char *src, size_t nelems, int pe)
void shmem_ushort_get(unsigned short *dest, const unsigned short *src, size_t nelems, int pe)
void shmem_uint_get(unsigned int *dest, const unsigned int *src, size_t nelems, int pe)
void shmem_ulong_get(unsigned long *dest, const unsigned long *src, size_t nelems, int pe)
void shmem_ulonglong_get(unsigned long long *dest, const unsigned long long *src, size_t nelems, int pe)
void shmem_int8_t_get(int8_t *dest, const int8_t *src, size_t nelems, int pe)
void shmem_uint8_t_get(uint8_t *dest, const uint8_t *src, size_t nelems, int pe)
void shmem_int16_t_get(int16_t *dest, const int16_t *src, size_t nelems, int pe)
void shmem_uint16_t_get(uint16_t *dest, const uint16_t *src, size_t nelems, int pe)
void shmem_int32_t_get(int32_t *dest, const int32_t *src, size_t nelems, int pe)
void shmem_uint32_t_get(uint32_t *dest, const uint32_t *src, size_t nelems, int pe)
void shmem_int64_t_get(int64_t *dest, const int64_t *src, size_t nelems, int pe)
void shmem_uint64_t_get(uint64_t *dest, const uint64_t *src, size_t nelems, int pe)
void shmem_size_t_get(size_t *dest, const size_t *src, size_t nelems, int pe)
void shmem_ptrdiff_t_get(ptrdiff_t *dest, const ptrdiff_t *src, size_t nelems, int pe)

shmem_TYPE_g

OpenSHMEM get operation with a single data

param src:

[in] Symmetric address from which the data is read

param pe:

[in] Unique identifier (rank) of the target

return:

TYPE data stored in #src on the rank pe

float shmem_float_g(const float *src, int pe)
double shmem_double_g(const double *src, int pe)
long double shmem_longdouble_g(const long double *src, int pe)
char shmem_char_g(const char *src, int pe)
signed char shmem_schar_g(const signed char *src, int pe)
short shmem_short_g(const short *src, int pe)
int shmem_int_g(const int *src, int pe)
long shmem_long_g(const long *src, int pe)
long long shmem_longlong_g(const long long *src, int pe)
unsigned char shmem_uchar_g(const unsigned char *src, int pe)
unsigned short shmem_ushort_g(const unsigned short *src, int pe)
unsigned int shmem_uint_g(const unsigned int *src, int pe)
unsigned long shmem_ulong_g(const unsigned long *src, int pe)
unsigned long long shmem_ulonglong_g(const unsigned long long *src, int pe)
int8_t shmem_int8_t_g(const int8_t *src, int pe)
uint8_t shmem_uint8_t_g(const uint8_t *src, int pe)
int16_t shmem_int16_t_g(const int16_t *src, int pe)
uint16_t shmem_uint16_t_g(const uint16_t *src, int pe)
int32_t shmem_int32_t_g(const int32_t *src, int pe)
uint32_t shmem_uint32_t_g(const uint32_t *src, int pe)
int64_t shmem_int64_t_g(const int64_t *src, int pe)
uint64_t shmem_uint64_t_g(const uint64_t *src, int pe)
size_t shmem_size_t_g(const size_t *src, int pe)
ptrdiff_t shmem_ptrdiff_t_g(const ptrdiff_t *src, int pe)

Functions

void shmem_getmem(void *dest, const void *source, size_t size, int pe)

OpenSHMEM get operation with a size in bytes instead of a count of typed objects.

Parameters:
  • dest[in] Local address in which the data is put

  • source[in] Symmetric address from which the data is read

  • size[in] Size in bytes to send

  • pe[in] Unique identifier (rank) of the target

OpenSHMEM defined atomic communications.

shmem_TYPE_atomic_fetch

Perform an atomic fetch on a given symmetric object

param src:

[in] Symmetric address of the element to fetch

param pe:

[in] Unique identifier (rank) of the target

return:

Fetched data

int pe
float shmem_float_atomic_fetch(const float *src, int pe)
double shmem_double_atomic_fetch(const double *src, int pe)
char shmem_char_atomic_fetch(const char *src, int pe)
signed char shmem_schar_atomic_fetch(const signed char *src, int pe)
short shmem_short_atomic_fetch(const short *src, int pe)
int shmem_int_atomic_fetch(const int *src, int pe)
long shmem_long_atomic_fetch(const long *src, int pe)
long long shmem_longlong_atomic_fetch(const long long *src, int pe)
unsigned char shmem_uchar_atomic_fetch(const unsigned char *src, int pe)
unsigned short shmem_ushort_atomic_fetch(const unsigned short *src, int pe)
unsigned int shmem_uint_atomic_fetch(const unsigned int *src, int pe)
unsigned long shmem_ulong_atomic_fetch(const unsigned long *src, int pe)
unsigned long long shmem_ulonglong_atomic_fetch(const unsigned long long *src, int pe)
int8_t shmem_int8_t_atomic_fetch(const int8_t *src, int pe)
uint8_t shmem_uint8_t_atomic_fetch(const uint8_t *src, int pe)
int16_t shmem_int16_t_atomic_fetch(const int16_t *src, int pe)
uint16_t shmem_uint16_t_atomic_fetch(const uint16_t *src, int pe)
int32_t shmem_int32_t_atomic_fetch(const int32_t *src, int pe)
uint32_t shmem_uint32_t_atomic_fetch(const uint32_t *src, int pe)
int64_t shmem_int64_t_atomic_fetch(const int64_t *src, int pe)
uint64_t shmem_uint64_t_atomic_fetch(const uint64_t *src, int pe)
size_t shmem_size_t_atomic_fetch(const size_t *src, int pe)
ptrdiff_t shmem_ptrdiff_t_atomic_fetch(const ptrdiff_t *src, int pe)

shmem_TYPE_atomic_set

Perform an atomic set on a given symmetric object

param dest:

[in] Symmetric address of the element to set

param value:

[in] Value to put in remote memory

param pe:

[in] Unique identifier (rank) of the target

float value
void shmem_float_atomic_set(float *dest, float value, int pe)
void shmem_double_atomic_set(double *dest, double value, int pe)
void shmem_char_atomic_set(char *dest, char value, int pe)
void shmem_schar_atomic_set(signed char *dest, signed char value, int pe)
void shmem_short_atomic_set(short *dest, short value, int pe)
void shmem_int_atomic_set(int *dest, int value, int pe)
void shmem_long_atomic_set(long *dest, long value, int pe)
void shmem_longlong_atomic_set(long long *dest, long long value, int pe)
void shmem_uchar_atomic_set(unsigned char *dest, unsigned char value, int pe)
void shmem_ushort_atomic_set(unsigned short *dest, unsigned short value, int pe)
void shmem_uint_atomic_set(unsigned int *dest, unsigned int value, int pe)
void shmem_ulong_atomic_set(unsigned long *dest, unsigned long value, int pe)
void shmem_ulonglong_atomic_set(unsigned long long *dest, unsigned long long value, int pe)
void shmem_int8_t_atomic_set(int8_t *dest, int8_t value, int pe)
void shmem_uint8_t_atomic_set(uint8_t *dest, uint8_t value, int pe)
void shmem_int16_t_atomic_set(int16_t *dest, int16_t value, int pe)
void shmem_uint16_t_atomic_set(uint16_t *dest, uint16_t value, int pe)
void shmem_int32_t_atomic_set(int32_t *dest, int32_t value, int pe)
void shmem_uint32_t_atomic_set(uint32_t *dest, uint32_t value, int pe)
void shmem_int64_t_atomic_set(int64_t *dest, int64_t value, int pe)
void shmem_uint64_t_atomic_set(uint64_t *dest, uint64_t value, int pe)
void shmem_size_t_atomic_set(size_t *dest, size_t value, int pe)
void shmem_ptrdiff_t_atomic_set(ptrdiff_t *dest, ptrdiff_t value, int pe)

shmem_TYPE_atomic_compare_swap

Perform an atomic compare and swap on a given symmetric object

param dest:

[in] Symmetric address of the element to set

param cond:

[in] Value expected in the remote memory

param value:

[in] Value to put in remote memory

param pe:

[in] Unique identifier (rank) of the target

retval old_data:

Previously held data (if condition passed)

retval current_data:

Value currently in the remote memory (otherwise)

int cond
float shmem_float_atomic_compare_swap(float *dest, float cond, float value, int pe)
double shmem_double_atomic_compare_swap(double *dest, double cond, double value, int pe)
char shmem_char_atomic_compare_swap(char *dest, char cond, char value, int pe)
signed char shmem_schar_atomic_compare_swap(signed char *dest, signed char cond, signed char value, int pe)
short shmem_short_atomic_compare_swap(short *dest, short cond, short value, int pe)
int shmem_int_atomic_compare_swap(int *dest, int cond, int value, int pe)
long shmem_long_atomic_compare_swap(long *dest, long cond, long value, int pe)
long long shmem_longlong_atomic_compare_swap(long long *dest, long long cond, long long value, int pe)
unsigned char shmem_uchar_atomic_compare_swap(unsigned char *dest, unsigned char cond, unsigned char value, int pe)
unsigned short shmem_ushort_atomic_compare_swap(unsigned short *dest, unsigned short cond, unsigned short value, int pe)
unsigned int shmem_uint_atomic_compare_swap(unsigned int *dest, unsigned int cond, unsigned int value, int pe)
unsigned long shmem_ulong_atomic_compare_swap(unsigned long *dest, unsigned long cond, unsigned long value, int pe)
unsigned long long shmem_ulonglong_atomic_compare_swap(unsigned long long *dest, unsigned long long cond, unsigned long long value, int pe)
int8_t shmem_int8_t_atomic_compare_swap(int8_t *dest, int8_t cond, int8_t value, int pe)
uint8_t shmem_uint8_t_atomic_compare_swap(uint8_t *dest, uint8_t cond, uint8_t value, int pe)
int16_t shmem_int16_t_atomic_compare_swap(int16_t *dest, int16_t cond, int16_t value, int pe)
uint16_t shmem_uint16_t_atomic_compare_swap(uint16_t *dest, uint16_t cond, uint16_t value, int pe)
int32_t shmem_int32_t_atomic_compare_swap(int32_t *dest, int32_t cond, int32_t value, int pe)
uint32_t shmem_uint32_t_atomic_compare_swap(uint32_t *dest, uint32_t cond, uint32_t value, int pe)
int64_t shmem_int64_t_atomic_compare_swap(int64_t *dest, int64_t cond, int64_t value, int pe)
uint64_t shmem_uint64_t_atomic_compare_swap(uint64_t *dest, uint64_t cond, uint64_t value, int pe)
size_t shmem_size_t_atomic_compare_swap(size_t *dest, size_t cond, size_t value, int pe)
ptrdiff_t shmem_ptrdiff_t_atomic_compare_swap(ptrdiff_t *dest, ptrdiff_t cond, ptrdiff_t value, int pe)

shmem_TYPE_atomic_swap

Perform an atomic swap on a given symmetric object

param dest:

[in] Symmetric address of the element to set

param value:

[in] Value to put in remote memory

param pe:

[in] Unique identifier (rank) of the target

retval old_data:

Previously held data

float shmem_float_atomic_swap(float *dest, float value, int pe)
double shmem_double_atomic_swap(double *dest, double value, int pe)
char shmem_char_atomic_swap(char *dest, char value, int pe)
signed char shmem_schar_atomic_swap(signed char *dest, signed char value, int pe)
short shmem_short_atomic_swap(short *dest, short value, int pe)
int shmem_int_atomic_swap(int *dest, int value, int pe)
long shmem_long_atomic_swap(long *dest, long value, int pe)
long long shmem_longlong_atomic_swap(long long *dest, long long value, int pe)
unsigned char shmem_uchar_atomic_swap(unsigned char *dest, unsigned char value, int pe)
unsigned short shmem_ushort_atomic_swap(unsigned short *dest, unsigned short value, int pe)
unsigned int shmem_uint_atomic_swap(unsigned int *dest, unsigned int value, int pe)
unsigned long shmem_ulong_atomic_swap(unsigned long *dest, unsigned long value, int pe)
unsigned long long shmem_ulonglong_atomic_swap(unsigned long long *dest, unsigned long long value, int pe)
int8_t shmem_int8_t_atomic_swap(int8_t *dest, int8_t value, int pe)
uint8_t shmem_uint8_t_atomic_swap(uint8_t *dest, uint8_t value, int pe)
int16_t shmem_int16_t_atomic_swap(int16_t *dest, int16_t value, int pe)
uint16_t shmem_uint16_t_atomic_swap(uint16_t *dest, uint16_t value, int pe)
int32_t shmem_int32_t_atomic_swap(int32_t *dest, int32_t value, int pe)
uint32_t shmem_uint32_t_atomic_swap(uint32_t *dest, uint32_t value, int pe)
int64_t shmem_int64_t_atomic_swap(int64_t *dest, int64_t value, int pe)
uint64_t shmem_uint64_t_atomic_swap(uint64_t *dest, uint64_t value, int pe)
size_t shmem_size_t_atomic_swap(size_t *dest, size_t value, int pe)
ptrdiff_t shmem_ptrdiff_t_atomic_swap(ptrdiff_t *dest, ptrdiff_t value, int pe)

shmem_TYPE_atomic_fetch_add

Perform an atomic fetch and add on a given symmetric object

param dest:

[in] Symmetric address of the element to set

param value:

[in] Value to add to the remote memory object

param pe:

[in] Unique identifier (rank) of the target

retval old_data:

Previously held data

float shmem_float_atomic_fetch_add(float *dest, float value, int pe)
double shmem_double_atomic_fetch_add(double *dest, double value, int pe)
char shmem_char_atomic_fetch_add(char *dest, char value, int pe)
signed char shmem_schar_atomic_fetch_add(signed char *dest, signed char value, int pe)
short shmem_short_atomic_fetch_add(short *dest, short value, int pe)
int shmem_int_atomic_fetch_add(int *dest, int value, int pe)
long shmem_long_atomic_fetch_add(long *dest, long value, int pe)
long long shmem_longlong_atomic_fetch_add(long long *dest, long long value, int pe)
unsigned char shmem_uchar_atomic_fetch_add(unsigned char *dest, unsigned char value, int pe)
unsigned short shmem_ushort_atomic_fetch_add(unsigned short *dest, unsigned short value, int pe)
unsigned int shmem_uint_atomic_fetch_add(unsigned int *dest, unsigned int value, int pe)
unsigned long shmem_ulong_atomic_fetch_add(unsigned long *dest, unsigned long value, int pe)
unsigned long long shmem_ulonglong_atomic_fetch_add(unsigned long long *dest, unsigned long long value, int pe)
int8_t shmem_int8_t_atomic_fetch_add(int8_t *dest, int8_t value, int pe)
uint8_t shmem_uint8_t_atomic_fetch_add(uint8_t *dest, uint8_t value, int pe)
int16_t shmem_int16_t_atomic_fetch_add(int16_t *dest, int16_t value, int pe)
uint16_t shmem_uint16_t_atomic_fetch_add(uint16_t *dest, uint16_t value, int pe)
int32_t shmem_int32_t_atomic_fetch_add(int32_t *dest, int32_t value, int pe)
uint32_t shmem_uint32_t_atomic_fetch_add(uint32_t *dest, uint32_t value, int pe)
int64_t shmem_int64_t_atomic_fetch_add(int64_t *dest, int64_t value, int pe)
uint64_t shmem_uint64_t_atomic_fetch_add(uint64_t *dest, uint64_t value, int pe)
size_t shmem_size_t_atomic_fetch_add(size_t *dest, size_t value, int pe)
ptrdiff_t shmem_ptrdiff_t_atomic_fetch_add(ptrdiff_t *dest, ptrdiff_t value, int pe)

shmem_TYPE_atomic_add

Perform an atomic add on a given symmetric object

param dest:

[in] Symmetric address of the element to set

param value:

[in] Value to add to the remote memory object

param pe:

[in] Unique identifier (rank) of the target

void shmem_float_atomic_add(float *dest, float value, int pe)
void shmem_double_atomic_add(double *dest, double value, int pe)
void shmem_char_atomic_add(char *dest, char value, int pe)
void shmem_schar_atomic_add(signed char *dest, signed char value, int pe)
void shmem_short_atomic_add(short *dest, short value, int pe)
void shmem_int_atomic_add(int *dest, int value, int pe)
void shmem_long_atomic_add(long *dest, long value, int pe)
void shmem_longlong_atomic_add(long long *dest, long long value, int pe)
void shmem_uchar_atomic_add(unsigned char *dest, unsigned char value, int pe)
void shmem_ushort_atomic_add(unsigned short *dest, unsigned short value, int pe)
void shmem_uint_atomic_add(unsigned int *dest, unsigned int value, int pe)
void shmem_ulong_atomic_add(unsigned long *dest, unsigned long value, int pe)
void shmem_ulonglong_atomic_add(unsigned long long *dest, unsigned long long value, int pe)
void shmem_int8_t_atomic_add(int8_t *dest, int8_t value, int pe)
void shmem_uint8_t_atomic_add(uint8_t *dest, uint8_t value, int pe)
void shmem_int16_t_atomic_add(int16_t *dest, int16_t value, int pe)
void shmem_uint16_t_atomic_add(uint16_t *dest, uint16_t value, int pe)
void shmem_int32_t_atomic_add(int32_t *dest, int32_t value, int pe)
void shmem_uint32_t_atomic_add(uint32_t *dest, uint32_t value, int pe)
void shmem_int64_t_atomic_add(int64_t *dest, int64_t value, int pe)
void shmem_uint64_t_atomic_add(uint64_t *dest, uint64_t value, int pe)
void shmem_size_t_atomic_add(size_t *dest, size_t value, int pe)
void shmem_ptrdiff_t_atomic_add(ptrdiff_t *dest, ptrdiff_t value, int pe)

shmem_TYPE_atomic_fetch_inc

Perform an atomic fetch and increment on a given symmetric object

param dest:

[in] Symmetric address of the element to increment

param pe:

[in] Unique identifier (rank) of the target

retval old_data:

Previously held data

float shmem_float_atomic_fetch_inc(float *dest, int pe)
double shmem_double_atomic_fetch_inc(double *dest, int pe)
char shmem_char_atomic_fetch_inc(char *dest, int pe)
signed char shmem_schar_atomic_fetch_inc(signed char *dest, int pe)
short shmem_short_atomic_fetch_inc(short *dest, int pe)
int shmem_int_atomic_fetch_inc(int *dest, int pe)
long shmem_long_atomic_fetch_inc(long *dest, int pe)
long long shmem_longlong_atomic_fetch_inc(long long *dest, int pe)
unsigned char shmem_uchar_atomic_fetch_inc(unsigned char *dest, int pe)
unsigned short shmem_ushort_atomic_fetch_inc(unsigned short *dest, int pe)
unsigned int shmem_uint_atomic_fetch_inc(unsigned int *dest, int pe)
unsigned long shmem_ulong_atomic_fetch_inc(unsigned long *dest, int pe)
unsigned long long shmem_ulonglong_atomic_fetch_inc(unsigned long long *dest, int pe)
int8_t shmem_int8_t_atomic_fetch_inc(int8_t *dest, int pe)
uint8_t shmem_uint8_t_atomic_fetch_inc(uint8_t *dest, int pe)
int16_t shmem_int16_t_atomic_fetch_inc(int16_t *dest, int pe)
uint16_t shmem_uint16_t_atomic_fetch_inc(uint16_t *dest, int pe)
int32_t shmem_int32_t_atomic_fetch_inc(int32_t *dest, int pe)
uint32_t shmem_uint32_t_atomic_fetch_inc(uint32_t *dest, int pe)
int64_t shmem_int64_t_atomic_fetch_inc(int64_t *dest, int pe)
uint64_t shmem_uint64_t_atomic_fetch_inc(uint64_t *dest, int pe)
size_t shmem_size_t_atomic_fetch_inc(size_t *dest, int pe)
ptrdiff_t shmem_ptrdiff_t_atomic_fetch_inc(ptrdiff_t *dest, int pe)

shmem_TYPE_atomic_inc

Perform an atomic increment on a given symmetric object

param dest:

[in] Symmetric address of the element to increment

param pe:

[in] Unique identifier (rank) of the target

void shmem_float_atomic_inc(float *dest, int pe)
void shmem_double_atomic_inc(double *dest, int pe)
void shmem_char_atomic_inc(char *dest, int pe)
void shmem_schar_atomic_inc(signed char *dest, int pe)
void shmem_short_atomic_inc(short *dest, int pe)
void shmem_int_atomic_inc(int *dest, int pe)
void shmem_long_atomic_inc(long *dest, int pe)
void shmem_longlong_atomic_inc(long long *dest, int pe)
void shmem_uchar_atomic_inc(unsigned char *dest, int pe)
void shmem_ushort_atomic_inc(unsigned short *dest, int pe)
void shmem_uint_atomic_inc(unsigned int *dest, int pe)
void shmem_ulong_atomic_inc(unsigned long *dest, int pe)
void shmem_ulonglong_atomic_inc(unsigned long long *dest, int pe)
void shmem_int8_t_atomic_inc(int8_t *dest, int pe)
void shmem_uint8_t_atomic_inc(uint8_t *dest, int pe)
void shmem_int16_t_atomic_inc(int16_t *dest, int pe)
void shmem_uint16_t_atomic_inc(uint16_t *dest, int pe)
void shmem_int32_t_atomic_inc(int32_t *dest, int pe)
void shmem_uint32_t_atomic_inc(uint32_t *dest, int pe)
void shmem_int64_t_atomic_inc(int64_t *dest, int pe)
void shmem_uint64_t_atomic_inc(uint64_t *dest, int pe)
void shmem_size_t_atomic_inc(size_t *dest, int pe)
void shmem_ptrdiff_t_atomic_inc(ptrdiff_t *dest, int pe)

Defines

shmem_atomic_fetch(src, pe) _Generic

(src,                                  \

float *:

shmem_float_atomic_fetch

,                 \

double *:

shmem_double_atomic_fetch

,               \

char *:

shmem_char_atomic_fetch,                   \ signed char *: shmem_schar_atomic_fetch

,           \

short *:

shmem_short_atomic_fetch

,                 \

int *:

shmem_int_atomic_fetch

,                     \

long *:

shmem_long_atomic_fetch

,                   \

long long *:

shmem_longlong_atomic_fetch

,          \

unsigned char *:

shmem_uchar_atomic_fetch

,         \

unsigned short *:

shmem_ushort_atomic_fetch

,       \

unsigned int *:

shmem_uint_atomic_fetch

,           \

unsigned long *:

shmem_ulong_atomic_fetch

,         \

unsigned long long *:

shmem_ulonglong_atomic_fetch

\

)(src,

pe)

OpenSHMEM atomic fetch operation.

Note

Generic counterpart of the shmem_TYPE_atomic_fetch functions.

Parameters:
  • src[in] Symmetric address from which the data is read

  • pe[in] Unique identifier (rank) of the target

shmem_fetch(src, pe) _Generic

(src,                  \

float *:

shmem_float_fetch

,        \

double *:

shmem_double_fetch

,      \

int *:

shmem_int_fetch

,            \

long *:

shmem_long_fetch

,          \

long long *:

shmem_longlong_fetch

, \

)(src,

pe)

OpenSHMEM atomic fetch operation.

Deprecated:

Use shmem_atomic_fetch instead

Note

Generic counterpart of the shmem_TYPE_fetch functions.

Parameters:
  • src[in] Symmetric address from which the data is read

  • pe[in] Unique identifier (rank) of the target

shmem_atomic_set(dest, value, pe) _Generic(value,                            \ float: shmem_float_atomic_set,                 \ double: shmem_double_atomic_set,               \ char: shmem_char_atomic_set,                   \ signed char: shmem_schar_atomic_set,           \ short: shmem_short_atomic_set,                 \ int: shmem_int_atomic_set,                     \ long: shmem_long_atomic_set

,                   \

long

long: shmem_longlong_atomic_set

,          \

unsigned

char: shmem_uchar_atomic_set

,         \

unsigned

short: shmem_ushort_atomic_set

,       \

unsigned

int: shmem_uint_atomic_set

,           \

unsigned

long: shmem_ulong_atomic_set

,         \

unsigned long

long: shmem_ulonglong_atomic_set

\

)(dest,

value, pe)

OpenSHMEM atomic set operation.

Note

Generic counterpart of the shmem_TYPE_atomic_set functions.

Parameters:
  • dest[in] Symmetric address of the element to set

  • value[in] Value to put in remote memory

  • pe[in] Unique identifier (rank) of the target

shmem_set(dest, value, pe) _Generic(value,            \ float: shmem_float_set,        \ double: shmem_double_set,      \ int: shmem_int_set,            \ long: shmem_long_set

,          \

long

long: shmem_longlong_set

, \

)(dest,

value, pe)

OpenSHMEM atomic set operation.

Deprecated:

Use shmem_atomic_set instead

Note

Generic counterpart of the shmem_TYPE_set functions.

Parameters:
  • dest[in] Symmetric address of the element to set

  • value[in] Value to put in remote memory

  • pe[in] Unique identifier (rank) of the target

shmem_atomic_compare_swap(dest, cond, value, pe) _Generic(value,                                     \ float: shmem_float_atomic_compare_swap,                 \ double: shmem_double_atomic_compare_swap,               \ char: shmem_char_atomic_compare_swap,                   \ signed char: shmem_schar_atomic_compare_swap,           \ short: shmem_short_atomic_compare_swap,                 \ int: shmem_int_atomic_compare_swap,                     \ long: shmem_long_atomic_compare_swap

,                   \

long

long: shmem_longlong_atomic_compare_swap

,          \

unsigned

char: shmem_uchar_atomic_compare_swap

,         \

unsigned

short: shmem_ushort_atomic_compare_swap

,       \

unsigned

int: shmem_uint_atomic_compare_swap

,           \

unsigned

long: shmem_ulong_atomic_compare_swap

,         \

unsigned long

long: shmem_ulonglong_atomic_compare_swap

\

)(dest,

cond, value, pe)

OpenSHMEM atomic compare and swap operation.

Note

Generic counterpart of the shmem_TYPE_atomic_compare_swap functions.

Parameters:
  • dest[in] Symmetric address of the element to swap

  • cond[in] Value expected in the remote memory

  • value[in] Value to put in remote memory

  • pe[in] Unique identifier (rank) of the target

Return values:
  • old_data – Previously held data (if condition passed)

  • current_data – Value currently in the remote memory (otherwise)

shmem_cswap(dest, cond, value, pe) _Generic(value,                    \ int: shmem_int_cswap,                  \ long: shmem_long_cswap

,                \

long

long: shmem_longlong_cswap

,       \

)(dest,

cond, value, pe)

OpenSHMEM atomic compare and swap operation.

Deprecated:

Use shmem_atomic_compare_swap instead

Note

Generic counterpart of the shmem_TYPE_cswap functions.

Parameters:
  • dest[in] Symmetric address of the element to swap

  • cond[in] Value expected in the remote memory

  • value[in] Value to put in remote memory

  • pe[in] Unique identifier (rank) of the target

Return values:
  • old_data – Previously held data (if condition passed)

  • current_data – Value currently in the remote memory (otherwise)

shmem_atomic_swap(dest, value, pe) _Generic(value,                             \ float: shmem_float_atomic_swap,                 \ double: shmem_double_atomic_swap,               \ char: shmem_char_atomic_swap,                   \ signed char: shmem_schar_atomic_swap,           \ short: shmem_short_atomic_swap,                 \ int: shmem_int_atomic_swap,                     \ long: shmem_long_atomic_swap

,                   \

long

long: shmem_longlong_atomic_swap

,          \

unsigned

char: shmem_uchar_atomic_swap

,         \

unsigned

short: shmem_ushort_atomic_swap

,       \

unsigned

int: shmem_uint_atomic_swap

,           \

unsigned

long: shmem_ulong_atomic_swap

,         \

unsigned long

long: shmem_ulonglong_atomic_swap

\

)(dest,

value, pe)

OpenSHMEM atomic swap operation.

Note

Generic counterpart of the shmem_TYPE_atomic_swap functions.

Parameters:
  • dest[in] Symmetric address of the element to swap

  • value[in] Value to put in remote memory

  • pe[in] Unique identifier (rank) of the target

Return values:

old_data – Previously held data

shmem_swap(dest, value, pe) _Generic(value,             \ float: shmem_float_swap,        \ double: shmem_double_swap,      \ int: shmem_int_swap,            \ long: shmem_long_swap

,          \

long

long: shmem_longlong_swap

, \

)(dest,

value, pe)

OpenSHMEM atomic swap operation.

Deprecated:

Use shmem_atomic_swap instead

Note

Generic counterpart of the shmem_TYPE_swap functions.

Parameters:
  • dest[in] Symmetric address of the element to swap

  • value[in] Value to put in remote memory

  • pe[in] Unique identifier (rank) of the target

Return values:

old_data – Previously held data

shmem_atomic_fetch_add(dest, value, pe) _Generic(value,                                  \ float: shmem_float_atomic_fetch_add,                 \ double: shmem_double_atomic_fetch_add,               \ char: shmem_char_atomic_fetch_add,                   \ signed char: shmem_schar_atomic_fetch_add,           \ short: shmem_short_atomic_fetch_add,                 \ int: shmem_int_atomic_fetch_add,                     \ long: shmem_long_atomic_fetch_add

,                   \

long

long: shmem_longlong_atomic_fetch_add

,          \

unsigned

char: shmem_uchar_atomic_fetch_add

,         \

unsigned

short: shmem_ushort_atomic_fetch_add

,       \

unsigned

int: shmem_uint_atomic_fetch_add

,           \

unsigned

long: shmem_ulong_atomic_fetch_add

,         \

unsigned long

long: shmem_ulonglong_atomic_fetch_add

\

)(dest,

value, pe)

OpenSHMEM atomic fetch and add operation.

Note

Generic counterpart of the shmem_TYPE_atomic_fetch_add functions.

Parameters:
  • dest[in] Symmetric address of the element to fetch and add to

  • value[in] Value to add to the remote memory object

  • pe[in] Unique identifier (rank) of the target

Return values:

old_data – Previously held data

shmem_fadd(dest, value, pe) _Generic(value,             \ int: shmem_int_fadd,            \ long: shmem_long_fadd

,          \

long

long: shmem_longlong_fadd

, \

)(dest,

value, pe)

OpenSHMEM atomic fetch and add operation.

Deprecated:

Use shmem_atomic_fetch_add instead

Note

Generic counterpart of the shmem_TYPE_fadd functions.

Parameters:
  • dest[in] Symmetric address of the element to fetch and add to

  • value[in] Value to add to the remote memory object

  • pe[in] Unique identifier (rank) of the target

Return values:

old_data – Previously held data

shmem_atomic_add(dest, value, pe) _Generic(value,                            \ float: shmem_float_atomic_add,                 \ double: shmem_double_atomic_add,               \ char: shmem_char_atomic_add,                   \ signed char: shmem_schar_atomic_add,           \ short: shmem_short_atomic_add,                 \ int: shmem_int_atomic_add,                     \ long: shmem_long_atomic_add

,                   \

long

long: shmem_longlong_atomic_add

,          \

unsigned

char: shmem_uchar_atomic_add

,         \

unsigned

short: shmem_ushort_atomic_add

,       \

unsigned

int: shmem_uint_atomic_add

,           \

unsigned

long: shmem_ulong_atomic_add

,         \

unsigned long

long: shmem_ulonglong_atomic_add

\

)(dest,

value, pe)

OpenSHMEM atomic add operation.

Note

Generic counterpart of the shmem_TYPE_atomic_add functions.

Parameters:
  • dest[in] Symmetric address of the element to add to

  • value[in] Value to add to the remote memory object

  • pe[in] Unique identifier (rank) of the target

shmem_add(dest, value, pe) _Generic(value,            \ int: shmem_int_add,            \ long: shmem_long_add

,          \

long

long: shmem_longlong_add

, \

)(dest,

value, pe)

OpenSHMEM atomic add operation.

Deprecated:

Use shmem_atomic_add instead

Note

Generic counterpart of the shmem_TYPE_add functions.

Parameters:
  • dest[in] Symmetric address of the element to add to

  • value[in] Value to add to the remote memory object

  • pe[in] Unique identifier (rank) of the target

shmem_atomic_fetch_inc(dest, pe) _Generic

(dest,                                     \

float *:

shmem_float_atomic_fetch_inc

,                 \

double *:

shmem_double_atomic_fetch_inc

,               \

char *:

shmem_char_atomic_fetch_inc,                   \ signed char *: shmem_schar_atomic_fetch_inc

,           \

short *:

shmem_short_atomic_fetch_inc

,                 \

int *:

shmem_int_atomic_fetch_inc

,                     \

long *:

shmem_long_atomic_fetch_inc

,                   \

long long *:

shmem_longlong_atomic_fetch_inc

,          \

unsigned char *:

shmem_uchar_atomic_fetch_inc

,         \

unsigned short *:

shmem_ushort_atomic_fetch_inc

,       \

unsigned int *:

shmem_uint_atomic_fetch_inc

,           \

unsigned long *:

shmem_ulong_atomic_fetch_inc

,         \

unsigned long long *:

shmem_ulonglong_atomic_fetch_inc

\

)(dest,

pe)

OpenSHMEM atomic fetch and increment operation.

Note

Generic counterpart of the shmem_TYPE_atomic_fetch_inc functions.

Parameters:
  • dest[in] Symmetric address of the element to fetch and increment

  • pe[in] Unique identifier (rank) of the target

Return values:

old_data – Previously held data

shmem_finc(dest, pe) _Generic(value,             \ int: shmem_int_finc,            \ long: shmem_long_finc

,          \

long

long: shmem_longlong_finc

, \

)(dest,

pe)

OpenSHMEM atomic fetch and increment operation.

Deprecated:

Use shmem_atomic_fetch_inc instead

Note

Generic counterpart of the shmem_TYPE_finc functions.

Parameters:
  • dest[in] Symmetric address of the element to fetch and increment

  • pe[in] Unique identifier (rank) of the target

Return values:

old_data – Previously held data

shmem_atomic_inc(dest, pe) _Generic

(dest,                               \

float *:

shmem_float_atomic_inc

,                 \

double *:

shmem_double_atomic_inc

,               \

char *:

shmem_char_atomic_inc,                   \ signed char *: shmem_schar_atomic_inc

,           \

short *:

shmem_short_atomic_inc

,                 \

int *:

shmem_int_atomic_inc

,                     \

long *:

shmem_long_atomic_inc

,                   \

long long *:

shmem_longlong_atomic_inc

,          \

unsigned char *:

shmem_uchar_atomic_inc

,         \

unsigned short *:

shmem_ushort_atomic_inc

,       \

unsigned int *:

shmem_uint_atomic_inc

,           \

unsigned long *:

shmem_ulong_atomic_inc

,         \

unsigned long long *:

shmem_ulonglong_atomic_inc

\

)(dest,

pe)

OpenSHMEM atomic increment operation.

Note

Generic counterpart of the shmem_TYPE_atomic_inc functions.

Parameters:
  • dest[in] Symmetric address of the element to increment

  • pe[in] Unique identifier (rank) of the target

shmem_inc(dest, pe) _Generic(value,            \ int: shmem_int_inc,            \ long: shmem_long_inc

,          \

long

long: shmem_longlong_inc

, \

)(dest,

pe)

OpenSHMEM atomic increment operation.

Deprecated:

Use shmem_atomic_inc instead

Note

Generic counterpart of the shmem_TYPE_inc functions.

Parameters:
  • dest[in] Symmetric address of the element to increment

  • pe[in] Unique identifier (rank) of the target

OpenSHMEM defined Collective Synchronizations routines.

Functions

void shmem_quiet(void)

Wait until the completion of all pending communications.

void shmem_fence(void)

Assess the ordering of communications.

void shmem_barrier_all(void)

Synchronize all tasks and guarantee the completion of all pending communication.

Standard Profiling API

group OpenSHMEM Profiling API

OpenSHMEM specification definitions.

Warning

The implementation of the specification is partial

OpenSHMEM thread support levels

static const int SHMEM_THREAD_SINGLE = 0

No support for multithreaded application is granted.

static const int SHMEM_THREAD_FUNNELED = 1024

Support for only one thread invoking OpenSHMEM API at a time is granted.

static const int SHMEM_THREAD_SERIALIZED = 2048

Support for non concurrent OpenSHMEM API calls is granted.

static const int SHMEM_THREAD_MULTIPLE = 4096

Full support for multithreading in OpenSHMEM calls.

OpenSHMEM library information

static const int SHMEM_MAJOR_VERSION = 1

Integer representing the major version of OpenSHMEM Specification in use.

static const int SHMEM_MINOR_VERSION = 6

Integer representing the minor version of OpenSHMEM Specification in use.

static const int SHMEM_MAX_NAME_LEN = 32

Integer representing the maximum length of SHMEM_VENDOR_STRING.

static const char SHMEM_VENDOR_STRING[] = "MPC"

String representing vendor defined information.

__attribute__ ((deprecated)) static const int _SHMEM_MAJOR_VERSION

Deprecated version of shmem_init.

@function shrealloc

@function shfree

@function shmalloc

@function _num_pes

@function _my_pe

Deprecated version of shmem_my_pe

Deprecated version of shmem_n_pes

Deprecated version of shmem_malloc

Deprecated version of shmem_free

OpenSHMEM defined Setup, Exit and Query routines.

Functions

void pshmem_init(void)

Initialize the OpenSHMEM runtime.

int pshmem_my_pe(void)

Query the rank of the local task.

Returns:

Rank of the local task (in the world context)

int pshmem_n_pes(void)

Query the number of the tasks.

Returns:

Number of tasks (in the world context)

void pshmem_query_initialized(int *initialized)

Query the initialization status of the library.

Parameters:
  • initialized[out] non-zero if the library is initialized. Zero othrewise.

void pshmem_finalize(void)

Finalize the OpenSHMEM runtime.

_Noreturn void pshmem_global_exit (int status)

Force terminate the entire program.

Any invocation of this routine must lead to the termination of all PEs. I/O are flushed and resources released accordingly to C/C++ requirements on program termination.

Parameters:
  • status – Exit status from the main program

void pshmem_info_get_version(int *major, int *minor)

Query the OpenSHMEM specification version of the library.

Parameters:
  • major[out] Major version of the specification

  • minor[out] Minor version of the specification

void pshmem_info_get_name(char *name)

Query the vendor name of the library.

Parameters:
  • name[out] Vendor name of the library

int pshmem_init_thread(int requested, int *provided)

Initialize the OpenSHMEM runtime to guarantee a certain level of multithreading.

Parameters:
  • requested[in] Level of multithreading requested

  • provided[out] Level of multithreading actually provided by the runtime

Returns:

0 upon success, a non-zero value otherwise

OpenSHMEM defined memory management routines.

Functions

void *pshmem_malloc(size_t size)

Allocate memory on the symmetric heap.

Parameters:
  • size[in] Size in Bytes of the memory region to allocate

Return values:
  • addr – Symmetric address to the allocated memory region

  • NULL – if the allocation failed

void pshmem_free(void *ptr)

Free a previously allocated region on the symmetric heap.

Parameters:
  • ptr[in] Pointer to the symmetric memory region to free

void *pshmem_realloc(void *ptr, size_t size)

Resize an allocation of symmetric memory.

Parameters:
  • ptr[in] Symmetric address of an object in the symmetric heap

  • size[in] The size, in Bytes, of a block to be allocated from the symmetric heap

Return values:
  • addr – Symmetric address to the resized memory region

  • NULL – if the allocation failed

void *pshmem_calloc(size_t count, size_t size)

Allocate a zeroed block of symmetric memory.

Parameters:
  • count[in] The number of elements to allocate

  • size[in] The size in bytes of each element to allocate

Return values:
  • addr – Symmetric address to the resized memory region

  • NULL – if the allocation failed

OpenSHMEM defined basic one-sided communications.

OpenSHMEM put-like defined communications.

pshmem_TYPE_put

OpenSHMEM put operation with multiple contigue data

param dest:

[in] Symmetric address in which the data is put

param src:

[in] Local address from which the data is read

param nelems:

[in] Number of elements of type TYPE to send

param pe:

[in] Unique identifier (rank) of the target

void pshmem_float_put(float *dest, const float *src, size_t nelems, int pe)
void pshmem_double_put(double *dest, const double *src, size_t nelems, int pe)
void pshmem_longdouble_put(long double *dest, const long double *src, size_t nelems, int pe)
void pshmem_char_put(char *dest, const char *src, size_t nelems, int pe)
void pshmem_schar_put(signed char *dest, const signed char *src, size_t nelems, int pe)
void pshmem_short_put(short *dest, const short *src, size_t nelems, int pe)
void pshmem_int_put(int *dest, const int *src, size_t nelems, int pe)
void pshmem_long_put(long *dest, const long *src, size_t nelems, int pe)
void pshmem_longlong_put(long long *dest, const long long *src, size_t nelems, int pe)
void pshmem_uchar_put(unsigned char *dest, const unsigned char *src, size_t nelems, int pe)
void pshmem_ushort_put(unsigned short *dest, const unsigned short *src, size_t nelems, int pe)
void pshmem_uint_put(unsigned int *dest, const unsigned int *src, size_t nelems, int pe)
void pshmem_ulong_put(unsigned long *dest, const unsigned long *src, size_t nelems, int pe)
void pshmem_ulonglong_put(unsigned long long *dest, const unsigned long long *src, size_t nelems, int pe)
void pshmem_int8_t_put(int8_t *dest, const int8_t *src, size_t nelems, int pe)
void pshmem_uint8_t_put(uint8_t *dest, const uint8_t *src, size_t nelems, int pe)
void pshmem_int16_t_put(int16_t *dest, const int16_t *src, size_t nelems, int pe)
void pshmem_uint16_t_put(uint16_t *dest, const uint16_t *src, size_t nelems, int pe)
void pshmem_int32_t_put(int32_t *dest, const int32_t *src, size_t nelems, int pe)
void pshmem_uint32_t_put(uint32_t *dest, const uint32_t *src, size_t nelems, int pe)
void pshmem_int64_t_put(int64_t *dest, const int64_t *src, size_t nelems, int pe)
void pshmem_uint64_t_put(uint64_t *dest, const uint64_t *src, size_t nelems, int pe)
void pshmem_size_t_put(size_t *dest, const size_t *src, size_t nelems, int pe)
void pshmem_ptrdiff_t_put(ptrdiff_t *dest, const ptrdiff_t *src, size_t nelems, int pe)

pshmem_TYPE_p

OpenSHMEM put operation with a single data

param dest:

[in] Symmetric address in which the data is put

param value:

[in] Local value to send

param pe:

[in] Unique identifier (rank) of the target

void pshmem_float_p(float *dest, const float value, int pe)
void pshmem_double_p(double *dest, const double value, int pe)
void pshmem_longdouble_p(long double *dest, const long double value, int pe)
void pshmem_char_p(char *dest, const char value, int pe)
void pshmem_schar_p(signed char *dest, const signed char value, int pe)
void pshmem_short_p(short *dest, const short value, int pe)
void pshmem_int_p(int *dest, const int value, int pe)
void pshmem_long_p(long *dest, const long value, int pe)
void pshmem_longlong_p(long long *dest, const long long value, int pe)
void pshmem_uchar_p(unsigned char *dest, const unsigned char value, int pe)
void pshmem_ushort_p(unsigned short *dest, const unsigned short value, int pe)
void pshmem_uint_p(unsigned int *dest, const unsigned int value, int pe)
void pshmem_ulong_p(unsigned long *dest, const unsigned long value, int pe)
void pshmem_ulonglong_p(unsigned long long *dest, const unsigned long long value, int pe)
void pshmem_int8_t_p(int8_t *dest, const int8_t value, int pe)
void pshmem_uint8_t_p(uint8_t *dest, const uint8_t value, int pe)
void pshmem_int16_t_p(int16_t *dest, const int16_t value, int pe)
void pshmem_uint16_t_p(uint16_t *dest, const uint16_t value, int pe)
void pshmem_int32_t_p(int32_t *dest, const int32_t value, int pe)
void pshmem_uint32_t_p(uint32_t *dest, const uint32_t value, int pe)
void pshmem_int64_t_p(int64_t *dest, const int64_t value, int pe)
void pshmem_uint64_t_p(uint64_t *dest, const uint64_t value, int pe)
void pshmem_size_t_p(size_t *dest, const size_t value, int pe)
void pshmem_ptrdiff_t_p(ptrdiff_t *dest, const ptrdiff_t value, int pe)

Functions

void pshmem_putmem(void *dest, const void *source, size_t size, int pe)

OpenSHMEM put operation with a size in bytes instead of a count of typed objects.

Parameters:
  • dest[in] Symmetric address in which the data is put

  • source[in] Local address from which the data is read

  • size[in] Size in bytes to send

  • pe[in] Unique identifier (rank) of the target

OpenSHMEM get-like defined communications.

pshmem_TYPE_get

OpenSHMEM get operation with multiple contigue data

param dest:

[in] Local address in which the data is put

param src:

[in] Symmetric address from which the data is read

param nelems:

[in] Number of elements of type TYPE to receive

param pe:

[in] Unique identifier (rank) of the target

void pshmem_float_get(float *dest, const float *src, size_t nelems, int pe)
void pshmem_double_get(double *dest, const double *src, size_t nelems, int pe)
void pshmem_longdouble_get(long double *dest, const long double *src, size_t nelems, int pe)
void pshmem_char_get(char *dest, const char *src, size_t nelems, int pe)
void pshmem_schar_get(signed char *dest, const signed char *src, size_t nelems, int pe)
void pshmem_short_get(short *dest, const short *src, size_t nelems, int pe)
void pshmem_int_get(int *dest, const int *src, size_t nelems, int pe)
void pshmem_long_get(long *dest, const long *src, size_t nelems, int pe)
void pshmem_longlong_get(long long *dest, const long long *src, size_t nelems, int pe)
void pshmem_uchar_get(unsigned char *dest, const unsigned char *src, size_t nelems, int pe)
void pshmem_ushort_get(unsigned short *dest, const unsigned short *src, size_t nelems, int pe)
void pshmem_uint_get(unsigned int *dest, const unsigned int *src, size_t nelems, int pe)
void pshmem_ulong_get(unsigned long *dest, const unsigned long *src, size_t nelems, int pe)
void pshmem_ulonglong_get(unsigned long long *dest, const unsigned long long *src, size_t nelems, int pe)
void pshmem_int8_t_get(int8_t *dest, const int8_t *src, size_t nelems, int pe)
void pshmem_uint8_t_get(uint8_t *dest, const uint8_t *src, size_t nelems, int pe)
void pshmem_int16_t_get(int16_t *dest, const int16_t *src, size_t nelems, int pe)
void pshmem_uint16_t_get(uint16_t *dest, const uint16_t *src, size_t nelems, int pe)
void pshmem_int32_t_get(int32_t *dest, const int32_t *src, size_t nelems, int pe)
void pshmem_uint32_t_get(uint32_t *dest, const uint32_t *src, size_t nelems, int pe)
void pshmem_int64_t_get(int64_t *dest, const int64_t *src, size_t nelems, int pe)
void pshmem_uint64_t_get(uint64_t *dest, const uint64_t *src, size_t nelems, int pe)
void pshmem_size_t_get(size_t *dest, const size_t *src, size_t nelems, int pe)
void pshmem_ptrdiff_t_get(ptrdiff_t *dest, const ptrdiff_t *src, size_t nelems, int pe)

pshmem_TYPE_g

OpenSHMEM get operation with a single data

param src:

[in] Symmetric address from which the data is read

param pe:

[in] Unique identifier (rank) of the target

return:

TYPE data stored in #src on the rank pe

float pshmem_float_g(const float *src, int pe)
double pshmem_double_g(const double *src, int pe)
long double pshmem_longdouble_g(const long double *src, int pe)
char pshmem_char_g(const char *src, int pe)
signed char pshmem_schar_g(const signed char *src, int pe)
short pshmem_short_g(const short *src, int pe)
int pshmem_int_g(const int *src, int pe)
long pshmem_long_g(const long *src, int pe)
long long pshmem_longlong_g(const long long *src, int pe)
unsigned char pshmem_uchar_g(const unsigned char *src, int pe)
unsigned short pshmem_ushort_g(const unsigned short *src, int pe)
unsigned int pshmem_uint_g(const unsigned int *src, int pe)
unsigned long pshmem_ulong_g(const unsigned long *src, int pe)
unsigned long long pshmem_ulonglong_g(const unsigned long long *src, int pe)
int8_t pshmem_int8_t_g(const int8_t *src, int pe)
uint8_t pshmem_uint8_t_g(const uint8_t *src, int pe)
int16_t pshmem_int16_t_g(const int16_t *src, int pe)
uint16_t pshmem_uint16_t_g(const uint16_t *src, int pe)
int32_t pshmem_int32_t_g(const int32_t *src, int pe)
uint32_t pshmem_uint32_t_g(const uint32_t *src, int pe)
int64_t pshmem_int64_t_g(const int64_t *src, int pe)
uint64_t pshmem_uint64_t_g(const uint64_t *src, int pe)
size_t pshmem_size_t_g(const size_t *src, int pe)
ptrdiff_t pshmem_ptrdiff_t_g(const ptrdiff_t *src, int pe)

Functions

void pshmem_getmem(void *dest, const void *source, size_t size, int pe)

OpenSHMEM get operation with a size in bytes instead of a count of typed objects.

Parameters:
  • dest[in] Local address in which the data is put

  • source[in] Symmetric address from which the data is read

  • size[in] Size in bytes to send

  • pe[in] Unique identifier (rank) of the target

OpenSHMEM defined atomic communications.

pshmem_TYPE_atomic_fetch

Perform an atomic fetch on a given symmetric object

param src:

[in] Symmetric address of the element to fetch

param pe:

[in] Unique identifier (rank) of the target

return:

Fetched data

float pshmem_float_atomic_fetch(const float *src, int pe)
double pshmem_double_atomic_fetch(const double *src, int pe)
char pshmem_char_atomic_fetch(const char *src, int pe)
signed char pshmem_schar_atomic_fetch(const signed char *src, int pe)
short pshmem_short_atomic_fetch(const short *src, int pe)
int pshmem_int_atomic_fetch(const int *src, int pe)
long pshmem_long_atomic_fetch(const long *src, int pe)
long long pshmem_longlong_atomic_fetch(const long long *src, int pe)
unsigned char pshmem_uchar_atomic_fetch(const unsigned char *src, int pe)
unsigned short pshmem_ushort_atomic_fetch(const unsigned short *src, int pe)
unsigned int pshmem_uint_atomic_fetch(const unsigned int *src, int pe)
unsigned long pshmem_ulong_atomic_fetch(const unsigned long *src, int pe)
unsigned long long pshmem_ulonglong_atomic_fetch(const unsigned long long *src, int pe)
int8_t pshmem_int8_t_atomic_fetch(const int8_t *src, int pe)
uint8_t pshmem_uint8_t_atomic_fetch(const uint8_t *src, int pe)
int16_t pshmem_int16_t_atomic_fetch(const int16_t *src, int pe)
uint16_t pshmem_uint16_t_atomic_fetch(const uint16_t *src, int pe)
int32_t pshmem_int32_t_atomic_fetch(const int32_t *src, int pe)
uint32_t pshmem_uint32_t_atomic_fetch(const uint32_t *src, int pe)
int64_t pshmem_int64_t_atomic_fetch(const int64_t *src, int pe)
uint64_t pshmem_uint64_t_atomic_fetch(const uint64_t *src, int pe)
size_t pshmem_size_t_atomic_fetch(const size_t *src, int pe)
ptrdiff_t pshmem_ptrdiff_t_atomic_fetch(const ptrdiff_t *src, int pe)

pshmem_TYPE_atomic_set

Perform an atomic set on a given symmetric object

param dest:

[in] Symmetric address of the element to set

param value:

[in] Value to put in remote memory

param pe:

[in] Unique identifier (rank) of the target

void pshmem_float_atomic_set(float *dest, float value, int pe)
void pshmem_double_atomic_set(double *dest, double value, int pe)
void pshmem_char_atomic_set(char *dest, char value, int pe)
void pshmem_schar_atomic_set(signed char *dest, signed char value, int pe)
void pshmem_short_atomic_set(short *dest, short value, int pe)
void pshmem_int_atomic_set(int *dest, int value, int pe)
void pshmem_long_atomic_set(long *dest, long value, int pe)
void pshmem_longlong_atomic_set(long long *dest, long long value, int pe)
void pshmem_uchar_atomic_set(unsigned char *dest, unsigned char value, int pe)
void pshmem_ushort_atomic_set(unsigned short *dest, unsigned short value, int pe)
void pshmem_uint_atomic_set(unsigned int *dest, unsigned int value, int pe)
void pshmem_ulong_atomic_set(unsigned long *dest, unsigned long value, int pe)
void pshmem_ulonglong_atomic_set(unsigned long long *dest, unsigned long long value, int pe)
void pshmem_int8_t_atomic_set(int8_t *dest, int8_t value, int pe)
void pshmem_uint8_t_atomic_set(uint8_t *dest, uint8_t value, int pe)
void pshmem_int16_t_atomic_set(int16_t *dest, int16_t value, int pe)
void pshmem_uint16_t_atomic_set(uint16_t *dest, uint16_t value, int pe)
void pshmem_int32_t_atomic_set(int32_t *dest, int32_t value, int pe)
void pshmem_uint32_t_atomic_set(uint32_t *dest, uint32_t value, int pe)
void pshmem_int64_t_atomic_set(int64_t *dest, int64_t value, int pe)
void pshmem_uint64_t_atomic_set(uint64_t *dest, uint64_t value, int pe)
void pshmem_size_t_atomic_set(size_t *dest, size_t value, int pe)
void pshmem_ptrdiff_t_atomic_set(ptrdiff_t *dest, ptrdiff_t value, int pe)

pshmem_TYPE_atomic_compare_swap

Perform an atomic compare and swap on a given symmetric object

param dest:

[in] Symmetric address of the element to set

param cond:

[in] Value expected in the remote memory

param value:

[in] Value to put in remote memory

param pe:

[in] Unique identifier (rank) of the target

retval old_data:

Previously held data (if condition passed)

retval current_data:

Value currently in the remote memory (otherwise)

float pshmem_float_atomic_compare_swap(float *dest, float cond, float value, int pe)
double pshmem_double_atomic_compare_swap(double *dest, double cond, double value, int pe)
char pshmem_char_atomic_compare_swap(char *dest, char cond, char value, int pe)
signed char pshmem_schar_atomic_compare_swap(signed char *dest, signed char cond, signed char value, int pe)
short pshmem_short_atomic_compare_swap(short *dest, short cond, short value, int pe)
int pshmem_int_atomic_compare_swap(int *dest, int cond, int value, int pe)
long pshmem_long_atomic_compare_swap(long *dest, long cond, long value, int pe)
long long pshmem_longlong_atomic_compare_swap(long long *dest, long long cond, long long value, int pe)
unsigned char pshmem_uchar_atomic_compare_swap(unsigned char *dest, unsigned char cond, unsigned char value, int pe)
unsigned short pshmem_ushort_atomic_compare_swap(unsigned short *dest, unsigned short cond, unsigned short value, int pe)
unsigned int pshmem_uint_atomic_compare_swap(unsigned int *dest, unsigned int cond, unsigned int value, int pe)
unsigned long pshmem_ulong_atomic_compare_swap(unsigned long *dest, unsigned long cond, unsigned long value, int pe)
unsigned long long pshmem_ulonglong_atomic_compare_swap(unsigned long long *dest, unsigned long long cond, unsigned long long value, int pe)
int8_t pshmem_int8_t_atomic_compare_swap(int8_t *dest, int8_t cond, int8_t value, int pe)
uint8_t pshmem_uint8_t_atomic_compare_swap(uint8_t *dest, uint8_t cond, uint8_t value, int pe)
int16_t pshmem_int16_t_atomic_compare_swap(int16_t *dest, int16_t cond, int16_t value, int pe)
uint16_t pshmem_uint16_t_atomic_compare_swap(uint16_t *dest, uint16_t cond, uint16_t value, int pe)
int32_t pshmem_int32_t_atomic_compare_swap(int32_t *dest, int32_t cond, int32_t value, int pe)
uint32_t pshmem_uint32_t_atomic_compare_swap(uint32_t *dest, uint32_t cond, uint32_t value, int pe)
int64_t pshmem_int64_t_atomic_compare_swap(int64_t *dest, int64_t cond, int64_t value, int pe)
uint64_t pshmem_uint64_t_atomic_compare_swap(uint64_t *dest, uint64_t cond, uint64_t value, int pe)
size_t pshmem_size_t_atomic_compare_swap(size_t *dest, size_t cond, size_t value, int pe)
ptrdiff_t pshmem_ptrdiff_t_atomic_compare_swap(ptrdiff_t *dest, ptrdiff_t cond, ptrdiff_t value, int pe)

pshmem_TYPE_atomic_swap

Perform an atomic swap on a given symmetric object

param dest:

[in] Symmetric address of the element to set

param value:

[in] Value to put in remote memory

param pe:

[in] Unique identifier (rank) of the target

retval old_data:

Previously held data

float pshmem_float_atomic_swap(float *dest, float value, int pe)
double pshmem_double_atomic_swap(double *dest, double value, int pe)
char pshmem_char_atomic_swap(char *dest, char value, int pe)
signed char pshmem_schar_atomic_swap(signed char *dest, signed char value, int pe)
short pshmem_short_atomic_swap(short *dest, short value, int pe)
int pshmem_int_atomic_swap(int *dest, int value, int pe)
long pshmem_long_atomic_swap(long *dest, long value, int pe)
long long pshmem_longlong_atomic_swap(long long *dest, long long value, int pe)
unsigned char pshmem_uchar_atomic_swap(unsigned char *dest, unsigned char value, int pe)
unsigned short pshmem_ushort_atomic_swap(unsigned short *dest, unsigned short value, int pe)
unsigned int pshmem_uint_atomic_swap(unsigned int *dest, unsigned int value, int pe)
unsigned long pshmem_ulong_atomic_swap(unsigned long *dest, unsigned long value, int pe)
unsigned long long pshmem_ulonglong_atomic_swap(unsigned long long *dest, unsigned long long value, int pe)
int8_t pshmem_int8_t_atomic_swap(int8_t *dest, int8_t value, int pe)
uint8_t pshmem_uint8_t_atomic_swap(uint8_t *dest, uint8_t value, int pe)
int16_t pshmem_int16_t_atomic_swap(int16_t *dest, int16_t value, int pe)
uint16_t pshmem_uint16_t_atomic_swap(uint16_t *dest, uint16_t value, int pe)
int32_t pshmem_int32_t_atomic_swap(int32_t *dest, int32_t value, int pe)
uint32_t pshmem_uint32_t_atomic_swap(uint32_t *dest, uint32_t value, int pe)
int64_t pshmem_int64_t_atomic_swap(int64_t *dest, int64_t value, int pe)
uint64_t pshmem_uint64_t_atomic_swap(uint64_t *dest, uint64_t value, int pe)
size_t pshmem_size_t_atomic_swap(size_t *dest, size_t value, int pe)
ptrdiff_t pshmem_ptrdiff_t_atomic_swap(ptrdiff_t *dest, ptrdiff_t value, int pe)

pshmem_TYPE_atomic_fetch_add

Perform an atomic fetch and add on a given symmetric object

param dest:

[in] Symmetric address of the element to set

param value:

[in] Value to add to the remote memory object

param pe:

[in] Unique identifier (rank) of the target

retval old_data:

Previously held data

float pshmem_float_atomic_fetch_add(float *dest, float value, int pe)
double pshmem_double_atomic_fetch_add(double *dest, double value, int pe)
char pshmem_char_atomic_fetch_add(char *dest, char value, int pe)
signed char pshmem_schar_atomic_fetch_add(signed char *dest, signed char value, int pe)
short pshmem_short_atomic_fetch_add(short *dest, short value, int pe)
int pshmem_int_atomic_fetch_add(int *dest, int value, int pe)
long pshmem_long_atomic_fetch_add(long *dest, long value, int pe)
long long pshmem_longlong_atomic_fetch_add(long long *dest, long long value, int pe)
unsigned char pshmem_uchar_atomic_fetch_add(unsigned char *dest, unsigned char value, int pe)
unsigned short pshmem_ushort_atomic_fetch_add(unsigned short *dest, unsigned short value, int pe)
unsigned int pshmem_uint_atomic_fetch_add(unsigned int *dest, unsigned int value, int pe)
unsigned long pshmem_ulong_atomic_fetch_add(unsigned long *dest, unsigned long value, int pe)
unsigned long long pshmem_ulonglong_atomic_fetch_add(unsigned long long *dest, unsigned long long value, int pe)
int8_t pshmem_int8_t_atomic_fetch_add(int8_t *dest, int8_t value, int pe)
uint8_t pshmem_uint8_t_atomic_fetch_add(uint8_t *dest, uint8_t value, int pe)
int16_t pshmem_int16_t_atomic_fetch_add(int16_t *dest, int16_t value, int pe)
uint16_t pshmem_uint16_t_atomic_fetch_add(uint16_t *dest, uint16_t value, int pe)
int32_t pshmem_int32_t_atomic_fetch_add(int32_t *dest, int32_t value, int pe)
uint32_t pshmem_uint32_t_atomic_fetch_add(uint32_t *dest, uint32_t value, int pe)
int64_t pshmem_int64_t_atomic_fetch_add(int64_t *dest, int64_t value, int pe)
uint64_t pshmem_uint64_t_atomic_fetch_add(uint64_t *dest, uint64_t value, int pe)
size_t pshmem_size_t_atomic_fetch_add(size_t *dest, size_t value, int pe)
ptrdiff_t pshmem_ptrdiff_t_atomic_fetch_add(ptrdiff_t *dest, ptrdiff_t value, int pe)

pshmem_TYPE_atomic_add

Perform an atomic add on a given symmetric object

param dest:

[in] Symmetric address of the element to set

param value:

[in] Value to add to the remote memory object

param pe:

[in] Unique identifier (rank) of the target

void pshmem_float_atomic_add(float *dest, float value, int pe)
void pshmem_double_atomic_add(double *dest, double value, int pe)
void pshmem_char_atomic_add(char *dest, char value, int pe)
void pshmem_schar_atomic_add(signed char *dest, signed char value, int pe)
void pshmem_short_atomic_add(short *dest, short value, int pe)
void pshmem_int_atomic_add(int *dest, int value, int pe)
void pshmem_long_atomic_add(long *dest, long value, int pe)
void pshmem_longlong_atomic_add(long long *dest, long long value, int pe)
void pshmem_uchar_atomic_add(unsigned char *dest, unsigned char value, int pe)
void pshmem_ushort_atomic_add(unsigned short *dest, unsigned short value, int pe)
void pshmem_uint_atomic_add(unsigned int *dest, unsigned int value, int pe)
void pshmem_ulong_atomic_add(unsigned long *dest, unsigned long value, int pe)
void pshmem_ulonglong_atomic_add(unsigned long long *dest, unsigned long long value, int pe)
void pshmem_int8_t_atomic_add(int8_t *dest, int8_t value, int pe)
void pshmem_uint8_t_atomic_add(uint8_t *dest, uint8_t value, int pe)
void pshmem_int16_t_atomic_add(int16_t *dest, int16_t value, int pe)
void pshmem_uint16_t_atomic_add(uint16_t *dest, uint16_t value, int pe)
void pshmem_int32_t_atomic_add(int32_t *dest, int32_t value, int pe)
void pshmem_uint32_t_atomic_add(uint32_t *dest, uint32_t value, int pe)
void pshmem_int64_t_atomic_add(int64_t *dest, int64_t value, int pe)
void pshmem_uint64_t_atomic_add(uint64_t *dest, uint64_t value, int pe)
void pshmem_size_t_atomic_add(size_t *dest, size_t value, int pe)
void pshmem_ptrdiff_t_atomic_add(ptrdiff_t *dest, ptrdiff_t value, int pe)

pshmem_TYPE_atomic_fetch_inc

Perform an atomic fetch and increment on a given symmetric object

param dest:

[in] Symmetric address of the element to increment

param pe:

[in] Unique identifier (rank) of the target

retval old_data:

Previously held data

float pshmem_float_atomic_fetch_inc(float *dest, int pe)
double pshmem_double_atomic_fetch_inc(double *dest, int pe)
char pshmem_char_atomic_fetch_inc(char *dest, int pe)
signed char pshmem_schar_atomic_fetch_inc(signed char *dest, int pe)
short pshmem_short_atomic_fetch_inc(short *dest, int pe)
int pshmem_int_atomic_fetch_inc(int *dest, int pe)
long pshmem_long_atomic_fetch_inc(long *dest, int pe)
long long pshmem_longlong_atomic_fetch_inc(long long *dest, int pe)
unsigned char pshmem_uchar_atomic_fetch_inc(unsigned char *dest, int pe)
unsigned short pshmem_ushort_atomic_fetch_inc(unsigned short *dest, int pe)
unsigned int pshmem_uint_atomic_fetch_inc(unsigned int *dest, int pe)
unsigned long pshmem_ulong_atomic_fetch_inc(unsigned long *dest, int pe)
unsigned long long pshmem_ulonglong_atomic_fetch_inc(unsigned long long *dest, int pe)
int8_t pshmem_int8_t_atomic_fetch_inc(int8_t *dest, int pe)
uint8_t pshmem_uint8_t_atomic_fetch_inc(uint8_t *dest, int pe)
int16_t pshmem_int16_t_atomic_fetch_inc(int16_t *dest, int pe)
uint16_t pshmem_uint16_t_atomic_fetch_inc(uint16_t *dest, int pe)
int32_t pshmem_int32_t_atomic_fetch_inc(int32_t *dest, int pe)
uint32_t pshmem_uint32_t_atomic_fetch_inc(uint32_t *dest, int pe)
int64_t pshmem_int64_t_atomic_fetch_inc(int64_t *dest, int pe)
uint64_t pshmem_uint64_t_atomic_fetch_inc(uint64_t *dest, int pe)
size_t pshmem_size_t_atomic_fetch_inc(size_t *dest, int pe)
ptrdiff_t pshmem_ptrdiff_t_atomic_fetch_inc(ptrdiff_t *dest, int pe)

pshmem_TYPE_atomic_inc

Perform an atomic increment on a given symmetric object

param dest:

[in] Symmetric address of the element to increment

param pe:

[in] Unique identifier (rank) of the target

void pshmem_float_atomic_inc(float *dest, int pe)
void pshmem_double_atomic_inc(double *dest, int pe)
void pshmem_char_atomic_inc(char *dest, int pe)
void pshmem_schar_atomic_inc(signed char *dest, int pe)
void pshmem_short_atomic_inc(short *dest, int pe)
void pshmem_int_atomic_inc(int *dest, int pe)
void pshmem_long_atomic_inc(long *dest, int pe)
void pshmem_longlong_atomic_inc(long long *dest, int pe)
void pshmem_uchar_atomic_inc(unsigned char *dest, int pe)
void pshmem_ushort_atomic_inc(unsigned short *dest, int pe)
void pshmem_uint_atomic_inc(unsigned int *dest, int pe)
void pshmem_ulong_atomic_inc(unsigned long *dest, int pe)
void pshmem_ulonglong_atomic_inc(unsigned long long *dest, int pe)
void pshmem_int8_t_atomic_inc(int8_t *dest, int pe)
void pshmem_uint8_t_atomic_inc(uint8_t *dest, int pe)
void pshmem_int16_t_atomic_inc(int16_t *dest, int pe)
void pshmem_uint16_t_atomic_inc(uint16_t *dest, int pe)
void pshmem_int32_t_atomic_inc(int32_t *dest, int pe)
void pshmem_uint32_t_atomic_inc(uint32_t *dest, int pe)
void pshmem_int64_t_atomic_inc(int64_t *dest, int pe)
void pshmem_uint64_t_atomic_inc(uint64_t *dest, int pe)
void pshmem_size_t_atomic_inc(size_t *dest, int pe)
void pshmem_ptrdiff_t_atomic_inc(ptrdiff_t *dest, int pe)

OpenSHMEM defined Collective Synchronizations routines.

Functions

void pshmem_quiet(void)

Wait until the completion of all pending communications.

void pshmem_fence(void)

Assess the ordering of communications.

void pshmem_barrier_all(void)

Synchronize all tasks and guarantee the completion of all pending communication.

Internals

group INTERNALS

MPC OpenSHMEM Internal datastructures and functions.

Defines

_mpc_oshmem_convert_mpi_request_to_lowcomm(__req) (((mpc_lowcomm_request_t *)__req) - 1)

Converts an MPI request (returned by mpc_lowcomm_request_alloc …) into a lowcomm request.

Typedefs

typedef struct _mpc_oshmem_context_s _mpc_oshmem_context_t

Context of OpenSHMEM task.

Functions

static inline bool __shmem_is_addr_bss(const void *const address, const _mpc_oshmem_context_t *const context)

Valid if the given address is from the .bss section.

Parameters:
  • address[in] Address to validate

Return values:
  • true – address is a valid .bss address

  • false – address is not located in the .bss section

static inline bool __shmem_is_addr_data(const void *const address, const _mpc_oshmem_context_t *const context)

Valid if the given address is from the .data section.

Parameters:
  • address[in] Address to validate

Return values:
  • true – address is a valid .data address

  • false – address is not located in the .data section

static inline bool __shmem_is_addr_symmetric_heap(const void *const address, const _mpc_oshmem_context_t *const context)

Valid if the given address is from the symmetric heap.

Parameters:
  • address[in] Address to validate

Return values:
  • true – address is a valid symmetric heap address

  • false – address is not located in the symmetric heap

static inline void *__oshmem_select_memory_region(const void *const address, const _mpc_oshmem_context_t *const context, mpc_lowcomm_window_t **window_p)

Selects the window to use for a communication based on an address.

Parameters:
  • address[in] Address to validate

  • context[in] Current OpenSHMEM context

  • window_p[out] Pointer to store the window to use

Return values:
  • The – start address (for offset computation) if is a valid symmetric address

  • NULL – if address is not a valid symmetric address

static void *_mpc_openshmem_internal_fetch_add_nb(const void *src, void *ret, const void *const operand, mpc_lowcomm_datatype_t datatype, int pe)

Common logic to perform a fetch and add atomic operation.

Note

This function is non-blocking

Parameters:
  • src[in] Remote address of the object to fetch

  • ret[out] Address to store the fetched item

  • operand[in] Address containing the element to add

  • datatype[in] Datatype of the object to fetch and add

  • pe[in] Unique identifier (rank) of the target

Returns:

Request to wait for blocking behavior

static void *_mpc_openshmem_internal_cswap_nb(void *dest, void *cond, void *value, mpc_lowcomm_datatype_t datatype, int pe)

Common logic to perform a compare and swap atomic operation.

Note

This function is non-blocking

Parameters:
  • dest[in] Remote address of the object to compare and swap against

  • cond[inout] Buffer containing the condition at start and the fetch value once the communication is completed

  • value[in] Buffer containing the object to put if the condition is fulfilled

  • datatype[in] Datatype of the object to compare and swap

  • pe[in] Unique identifier (rank) of the target

Returns:

Request to wait for blocking behavior

static void *_mpc_openshmem_internal_swap_nb(void *dest, void *value, mpc_lowcomm_datatype_t datatype, int pe)

Common logic to perform a swap atomic operation.

Note

This function is non-blocking

Parameters:
  • dest[in] Remote address of the object to compare and swap against

  • value[in] Buffer containing the object to put at target and containing fetched value

  • datatype[in] Datatype of the object to compare and swap

  • pe[in] Unique identifier (rank) of the target

Returns:

Request to wait for blocking behavior

struct _mpc_oshmem_context_s

Context of OpenSHMEM task.

Public Members

mpc_lowcomm_window_t *symmetric_heap_window

Window to target the symmetric heap.

mpc_lowcomm_window_t *user_bss_window

Window to target static variables.

mpc_lowcomm_window_t *user_data_window

Window to target global variables.

void *symmetric_heap_start

First address of the symmetric heap.

void *user_bss_start

First address of the .bss ELF section.

void *user_data_start

First address of the .data ELF section.

size_t symmetric_heap_size

Total size of the symmetric heap.

size_t user_bss_size

Total size of the .bss ELF section.

size_t user_data_size

Total size of the .data ELF section.

_Atomic volatile ssize_t refcount

Counter of the number of refs on the context.

mpc_common_spinlock_t context_lock

Lock to manipulate the context.

Symmetric memory management related items.

Unnamed Group

typedef struct _mpc_openshmem_stack_info_s __oshmem_stack_info_t

Information of the symmetric stack.

Functions

void *mpc_openshmem_memory_symmetric_stack_init(size_t *size)

Initialized the fixed size buffer stack.

This simple stack is used to allocate and deallocate memory from the symmetric heap

Parameters:
  • size[in] Total size of the stack to create (in Bytes) and real size allocated upon return

Return values:

NULL – if the allocation failed

Returns:

Address of the initialized stack

void *mpc_openshmem_memory_symmetric_stack_alloc(void *stack, const size_t size)

Allocate a memory block on the symmetric stack.

Allocation is always made to the top of the stack

Parameters:
Return values:

NULL – if the stack is full

Returns:

A valid symmetric pointer

void *mpc_openshmem_memory_symmetric_stack_resize(void *stack, void *ptr, const size_t new_size)

Try to resize an already allocated block on the symmetric stack.

If the block to resize isn’t the last on the stack, we have to allocate a new block.

Parameters:
  • stack[in] Address identifying the stack (the one returned by mpc_openshmem_memory_symmetric_stack_init)

  • ptr[in] Address of the previous block to resize

  • new_size[in] New size of the block (in Bytes)

Return values:

NULL – if the stack is full

Returns:

Address of the resized block

void mpc_openshmem_memory_symmetric_stack_free(void *stack, void *ptr)

Try to free a block from the symmetric stack.

A memory block is deallocated only if it the last allocation made to date.

Parameters:
void mpc_openshmem_memory_symmetric_stack_deinit(void *start_addr)

Relinquish the symmetric stack.

Parameters:
  • start_addr[in] Address of the allocated stack

struct _mpc_openshmem_stack_info_s

Information of the symmetric stack.

Public Members

int canary

Canary for integrity checking.

mpc_common_spinlock_t lock

Lock for thread safe access.

void *bottom

First address of the stack.

size_t size

Fixed size of the whole stack.

ptrdiff_t top

Offset to next free block in the stack.

size_t last_block_size

Size of the last allocation.

char padding[22]

Pad to 64 bytes to align the following header.