shmem_short_add

Purpose

Performs an atomic add operation on a symmetric data object.

C syntax

#include <shmem.h>
 
void shmem_short_add(short *target, short value, int pe);
 

Parameters

INPUT
target
The remotely accessible integer data object to be updated on the PE.
value
Value to be atomically written to the target PE. Value is the same type as target.
pe
An integer indicating the PE number on which target is to be updated.

Description

The shmem_short_add routine performs an atomic add operation.

It adds value to the variable pointed by target on the processing element specified by pe.

The atomic accessing of the shared variable is guaranteed only when that variable is updated solely using IBM openshmem functions.

IBM NOTES

To utilize the hardware atomic operations support of the PERCS system, the variables of these operations should be aligned with their natural byte alignments. For example, an int variable should be 4-byte aligned; a long long variable should be 8-byte aligned. If the participating variables are not aligned, the operation is done in software with sub-optimal performance

C examples



Related information

Subroutines: shmem_fadd, shmem_short_cswap


OpenSHMEM API Index