SHMEM_LONGLONG_FINC(3)

πŸ“¦
version 5.0.10 Β· 4 versions
, in ubuntu stonking

πŸ’– SHMEM_LONGLONG_FINC(3) πŸ’–

ok so bestie. welcome to the Open MPI section 3 manual, and today's main character is a whole family of fetch-and-increment girlies: shmem_int4_finc(3), shmem_int8_finc(3), shmem_int_finc(3), shmem_long_finc(3), and shmem_longlong_finc(3). together they perform an atomic fetch-and-increment operation on a remote data object. no cap. so iconic of them.


✨ 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 πŸ’…

ok so the fetch and increment routines are giving very specific energy: they grab the value sitting at address target on PE pe, and then they update target with the result of incrementing that retrieved value by one. yes, both. the fetch and the increment. she does it all πŸ’…

and the way that this must be completed without the possibility of another process updating target between the time of the fetch and the update? that's the whole point, that's the atomicity, that's the vibe check passing. no interlopers, no sneaky second writer, periodt.

the arguments are as follows:

  • target β€” the remotely accessible integer data object that's gonna get updated on the remote PE. the type of target should match that implied in the SYNOPSIS section (so like, don't be out here mismatching, bestie πŸ™ˆ).
  • pe β€” an integer that indicates the PE number upon which target is to be updated. if you're using Fortran, it must be a default integer value. fr fr.

πŸ“ NOTES πŸ“

the term remotely accessible is defined over in intro_shmem(3). go read her, she explains everything. iykyk.


πŸŽ€ RETURN VALUES πŸŽ€

she hands you back the contents that had been at the target address on the remote PE prior to the increment. so you get the old number, and the remote object gets the new one. teamwork, babes. 🫢

See also:


🌈 and that's the whole page, bestie! now go increment something atomically, you absolute legend πŸ‘‘

big love and eternal copyright to 2003-2026, The Open MPI Community πŸ’œ and this lil masterpiece was dated Sep 10, 2026 β€” shout out to SHMEM_LONGLONG_FINC(3), you ate and left no crumbs πŸ“βœ¨

πŸ“¦ where this page comes from