SHMEM_INT_FINC(3)
π SHMEM_INT_FINC(3) β the Open MPI glow-up
ok so bestie, we're talking about shmem_int4_finc(3), shmem_int8_finc(3), shmem_int_finc(3), shmem_long_finc(3), and shmem_longlong_finc(3) β and what they do is literally "Performs an atomic fetch-and-increment operation on a remote data object". that's the whole vibe. atomic remote increment. she's iconic, she's tiny, she's doing the most. β¨
π SYNOPSIS
C or C++, bestie:
#include <mpp/shmem.h>
int shmem_int_finc(int *target, int pe)
long shmem_long_finc(long *target, int pe)
long long shmem_longlong_finc(long long *target, int pe)
Fortran girlies, this one's for you:
INCLUDE "mpp/shmem.fh"
INTEGER pe
INTEGER(KIND=4) SHMEM_INT4_FINC, target4
INTEGER(KIND=8) SHMEM_INT8_FINC, target8
ires4 = SHMEM_INT4_FINC(target4, pe)
ires8 = SHMEM_INT8_FINC(target8, pe)
no cap, that's the whole call. π«Ά
πΈ DESCRIPTION
okay so picture it: the fetch-and-increment routines go grab the value sitting at address target on PE pe, and then they update target with the result of incrementing that grabbed value by one. simple. clean. gorgeous. π
but here's the part that matters β the operation must be completed without the possibility of another process updating target between the time of the fetch and the update. that's the atomicity, that's the whole assignment, that's the point. no sneaky interleaving allowed. periodt. π₯
the arguments are as follows:
targetβ the remotely accessible integer data object to be updated on the remote PE. the type oftargetshould match that implied in the SYNOPSIS section (iykyk β don't go mixing your ints up, bestie, it will not slay).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. that's a whole requirement, not a suggestion. π¦
β NOTES
the term remotely accessible is defined in intro_shmem(3). she has her own lore page. go read it. π
π RETURN VALUES
the function gives you back the contents that had been at the target address on the remote PE prior to the increment. so like, the old value. the before-picture. the pre-increment realness. main character energy from the past. π
π SEE ALSO:
that's it, that's the list, but she's an important one. π§
π COPYRIGHT
2003-2026, The Open MPI Community
ngl bestie, that's the entire page β every function name, every type, every argument, every caveat, all of it accounted for. now go increment something remotely and atomically, you absolute legend. β¨
okay and for the cute sign-off: this whole thing is from Open MPI, and the page is dated May 14, 2026 β SHMEM_INT_FINC(3), forever and always. πππ¦
π¦ where this page comes from
- arch rolling: nvhpc-comm-libs 26.9-1 Β· LicenseRef-NVIDIA-HPC-SDK
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms