SHMEM_LONG_INC(3)
π NAME π
okay so bestie, meet the atomic-increment girlies: shmem_int4_inc(3), shmem_int8_inc(3), shmem_int_inc(3), shmem_long_inc(3), and shmem_longlong_inc(3). They're from Open MPI's SHMEM_LONG_INC(3) page, and what they do is perform an atomic increment operation on a remote data object. β¨
Like, one whole atomic increment. On somebody else's data. From across the network. No cap. π«Ά
β¨ SYNOPSIS β¨
C or C++:
#include <mpp/shmem.h>
int shmem_int_inc(int *target, int pe)
long shmem_long_inc(long *target, int pe)
long long shmem_longlong_inc(long long *target, int pe)
Fortran:
INCLUDE "mpp/shmem.fh"
INTEGER pe
INTEGER(KIND=4) SHMEM_INT4_INC, target4
INTEGER(KIND=8) SHMEM_INT8_INC, target8
ires4 = SHMEM_INT4_INC(target4, pe)
ires8 = SHMEM_INT8_INC(target8, pe)
πΈ DESCRIPTION πΈ
So the atomic increment routines replace the value of target with its value incremented by one. That's it. That's the whole job. Adding one. π
But here's the part that's giving main character energy: the operation must be completed without the possibility of another process updating target between the time of the fetch and the update. Like, nobody else gets to sneak in there. Atomic means atomic, periodt. π₯
The arguments are as follows:
targetβ the remotely accessible integer data object that's gonna get updated on the remote PE. The type oftargetshould match whatever is implied up in the SYNOPSIS section, bestie. Don't mix them up, iykyk.peβ an integer that indicates the PE number upon whichtargetis to be updated. If you're using Fortran, it must be a default integer value, okay? No fancy kinds here. π
π NOTES π
The term remotely accessible is defined over in intro_shmem(3). Go read that one if you need the lore. π¦
π RETURN VALUES π
None. Nothing. Nada. She does the thing and does not report back, iconic behavior honestly. π
See also:
π Copyright π
2003-2026, The Open MPI Community
k that's the whole page, bestie!! this one is from Open MPI, page SHMEM_LONG_INC(3), and it was dated Sep 10, 2026. go increment something responsibly, mwah πβ¨
π¦ 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