Performs an atomic conditional swap to a symmetric data object.
#include <shmem.h> long shmem_long_cswap(long *target, long cond, long value, int pe);
This conditional swap routine conditionally update a target data object on an arbitrary processing element (PE) and return prior contents of the data object in one atomic operation.
The function shmem_long_cswap performs an atomic conditional operation on a remotely accessible long data object.
The atomic accessing of the shared variable is guaranteed only when that variable is updated solely using IBM openshmem functions.
This function returns the contents that had been at the target address on the remote PE prior to the swap is returned.
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
Subroutines: shmem_swap