SHMEM_LONG_INC(3)

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

πŸ’– 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 of target should 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 which target is 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:


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