SHMEM_ADD(3)
π SHMEM_ADD(3) π
okay so this is the Open MPI manual page for the atomic add besties, and it's lowkey iconic when you need one PE to update another PE's integer without any messy race drama. β¨
πΈ NAME πΈ
shmem_int_add(3)shmem_int4_add(3)shmem_int8_add(3)shmem_long_add(3)shmem_longlong_add(3)
β these do an atomic add operation. periodt. π
β¨ SYNOPSIS β¨
C or C++:
#include <mpp/shmem.h>
void shmem_int_add(int *target, int value, int pe);
void shmem_long_add(long *target, long value, int pe);
void shmem_longlong_add(long long *target, long long value,
int pe);
Fortran:
include 'mpp/shmem.h'
INTEGER pe
CALL SHMEM_INT4_ADD(target, value, pe)
CALL SHMEM_INT8_ADD(target, value, pe)
π¦ DESCRIPTION π¦
The atomic add routines add value to the data at address target on PE pe. The operation finishes with no chance of another process updating target between the time of the fetch and the update. π
The arguments are as follows:
targetβ the remotely accessible integer data object that's getting updated on the remote PE. If you're using C/C++, the type oftargetshould match what the SYNOPSIS section implies. If you're using the Fortran compiler, it must be of typeintegerwith an element size of4bytes forSHMEM_INT4_ADDand8bytes forSHMEM_INT8_ADD. πvalueβ the value to be atomically added totarget. If you're using C/C++, the type ofvalueshould match what the SYNOPSIS section implies. If you're using Fortran, it must be of typeintegerwith an element size oftarget. πpeβ an integer that indicates the PE number upon whichtargetis to be updated. If you're using Fortran, it must be a defaultintegervalue. π«Ά
π§ NOTES π§
The term remotely accessible is defined in intro_shmem(3). no cap, go read that if you need the lore. π
π SEE ALSO π
intro_shmem(3)shmem_cache(3)
mwah π β this page came from the gitclone source, version Unreleased developer copy, and the footer stamps it SHMEM_ADD(3). π
π¦ where this page comes from
- arch rolling: nvhpc-comm-libs 26.9-1 Β· LicenseRef-NVIDIA-HPC-SDK
- Copyright (c) 2015 University of Houston. All rights reserved
- Copyright (c) 2015 Mellanox Technologies, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms