SHMEM_FINC(3)
π SHMEM_FINC(3) β Open MPIβs atomic fetch-and-increment, bestie edition π
Okay so this is the Open MPI manual page for SHMEM_FINC(3), and itβs giving atomic remote fetch-and-increment main character energy. No cap, these routines are here to do one very specific little slay.
β¨ NAME β¨
The squad is:
shmem_int4_finc(3)shmem_int8_finc(3)shmem_int_finc(3)shmem_long_finc(3)shmem_longlong_finc(3)
And what do they do? They perform an atomic fetch-and-increment operation on a remote data object. Periodt. π
π SYNOPSIS π
C or C++:
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:
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 π¦
Bestie, hereβs the vibe: the fetch-and-increment routines grab the value at address target on PE pe, then update target with the result of incrementing that retrieved value by one. Iconic. π
And the very important part? 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 of it all β itβs not just cute, itβs required. π
The arguments are giving:
targetβ the remotely accessible integer data object to be updated on the remote PE. The type oftargetshould match that implied in the SYNOPSIS section. Donβt try to be mysterious with the type, okay? Match it. π«Άpeβ an integer that indicates the PE number upon whichtargetis to be updated. If you are using Fortran, it must be a default integer value. Fr fr, default integer. β¨
π NOTES π
The term remotely accessible is defined in intro_shmem(3). Thatβs the lore, iykyk. πΈ
π RETURN VALUES π
These routines return the contents that had been at the target address on the remote PE prior to the increment. So you get the old value back, and the remote object gets the +1 glow-up. π
π SEE ALSO π
intro_shmem(3)β go read it, bestie, thatβs where βremotely accessibleβ gets its definition. π¦
Source/version check: the footer says gitclone, Unreleased developer copy, and echoes SHMEM_FINC(3). Date? Not listed in this footer, so itβs lowkey timeless. Stay atomic, bestie. π
β¨
π¦ where this page comes from
- arch rolling: nvhpc-comm-libs 26.9-1 Β· LicenseRef-NVIDIA-HPC-SDK
- Copyright (c) 2015 University of Houston. All rights reserved
- Copyright (c) 2015 Mellanox Technologies, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms