SHMEM_INT_FINC(3)
β¨ SHMEM_INT_FINC(3) β Open MPI β¨
okay bestie, welcome to the Open MPI manual, and buckle up because this one is genuinely a bop π
πΈ NAME πΈ
shmem_int4_finc(3), shmem_int8_finc(3), shmem_int_finc(3), shmem_long_finc(3), shmem_longlong_finc(3) β Performs an atomic fetch-and-increment operation on a remote data object.
no cap, that's the whole vibe: grab a number off someone else's process, bump it by one, and do it so cleanly that nobody can sneak in between. it's giving main character energy at the memory-consistency level π
π SYNOPSIS π
C or C++
#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
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)
π DESCRIPTION π
so the fetch-and-increment routines do two things and they do them together, which is the whole point. they retrieve the value sitting at address target on PE pe, and then they update target with the result of incrementing that retrieved value by one. π
and here's the part that matters, so like, don't skip it: 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 tea. no gaps, no window, no "oops someone else got there first". periodt. π₯
the arguments are, as follows:
targetβ the remotely accessible integer data object that's getting updated on the remote PE. the type oftargetshould match the type implied up in the SYNOPSIS section, okay? don't mix and match, it's not that kind of party.peβ an integer that indicates the PE number upon whichtargetis to be updated. if you're writing Fortran, it must be a default integer value. β¨
π¦ NOTES π¦
the term remotely accessible is defined in intro_shmem(3). go peek if you're unsure, iykyk π§
π RETURN VALUES π
what you get back is 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 glow-up is happening remotely and you just get the receipts π
See also:
π Copyright π
2003-2026, The Open MPI Community
and that's the whole page, bestie π«Ά this was SHMEM_INT_FINC(3) from Open MPI, last touched Sep 10, 2026 β go forth, increment atomically, and slay πβ¨π
π¦ 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