SHMEM_LONGLONG_ADD(3)
π NAME π
okay so bestie, welcome to SHMEM_LONGLONG_ADD(3) from Open MPI β the atomic-add page, and yes she has many aliases because one name was simply not enough for her.
The whole girl squad of "add value to a thing, atomically":
shmem_int_addshmem_int4_addshmem_int8_addshmem_long_addshmem_longlong_add
β¦and they all do ONE thing: perform an atomic add operation. that's it. that's the whole personality. π
β¨ 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 π
so the atomic add routines literally just add value to the data sitting at address target on PE pe. and here's the iconic part, the main character energy: the operation completes without the possibility of another process updating target between the time of the fetch and the update. no interlopers. no sneaky concurrent writes. it's giving locked in. π₯
the arguments, let's go:
targetβ the remotely accessible integer data object that's getting updated on the remote PE. iykyk: if you're in C/C++, the type oftargetshould match what's implied in the SYNOPSIS section up there. if you're in Fortran, it must be of typeintegerwith an element size of 4 bytes forSHMEM_INT4_ADDand 8 bytes forSHMEM_INT8_ADD. get those sizes right or don't come to the function call. π«Άvalueβ the value being atomically added totarget. C/C++ bestie? type should match the SYNOPSIS section. Fortran bestie? it must be of typeintegerwith an element size oftarget. πpeβ an integer that says which PE numbertargetis going to be updated on. Fortran girlies: it must be a default integer value. β¨
π NOTES π
quick vocab check: the term remotely accessible is defined over in intro_shmem(3). go read her, she's the lore.
See also:
intro_shmem(3)shmem_cache(3)
π Copyright π
2003-2026, The Open MPI Community
and that's the page, bestie!! π¦πΈβ¨ this was SHMEM_LONGLONG_ADD(3) from Open MPI, dropped on Sep 10, 2026 β slay, now go atomically add something. periodt. π
π
π¦ where this page comes from
- ubuntu stonking: openmpi-doc 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms