SHMEM_INT_INC(3)

πŸ’– SHMEM_INT_INC(3) πŸ’–

okay bestie, this one lives in the Open MPI family, and it's the manual page for a whole squad of little functions:

and they all do one iconic thing: an atomic increment on a remote data object. that's it, that's the whole personality. ✨


🌸 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 basically, the atomic increment routines replace the value of target with its value incremented by one. and the glow-up part is that the operation must be completed without the possibility of another process updating target between the time of the fetch and the update. no sneaky little race condition is getting in here, periodt. πŸ”₯

The arguments are as follows:

  • target β€” the remotely accessible integer data object to be updated on the remote PE. the type of target should match that implied in the SYNOPSIS section (iykyk, keep your types matching 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.

πŸŽ€ NOTES πŸŽ€

the term remotely accessible is defined over in intro_shmem(3). go read that if you need the full lore. πŸ“–


πŸ¦‹ RETURN VALUES πŸ¦‹

None. that's right, nothing. no return value, no drama. πŸ’€

See also:


2003-2026, The Open MPI Community


and that's the whole page bestie, you ate it πŸ’…βœ¨ this was the SHMEM_INT_INC(3) page from the Open MPI manual, dated Sep 10, 2026 β€” go forth and increment atomically, mwah πŸ«ΆπŸ’–

πŸ“¦ where this page comes from