SHMEM_LONGLONG_FETCH(3)
π SHMEM_LONGLONG_FETCH π
okay bestie, gather round, because we're about to talk about atomically fetching the value of a remote data object and honestly? it's giving main character energy. this page covers a whole lil squad of functions:
shmem_int4_fetch(3)shmem_int8_fetch(3)shmem_int_fetch(3)shmem_long_fetch(3)shmem_longlong_fetch(3)shmem_double_fetch(3)shmem_float_fetch(3)
that's straight from Open MPI, no cap. π¦
β¨ SYNOPSIS β¨
C or C++
#include <mpp/shmem.h>
int shmem_int_fetch(int *target, int pe)
long shmem_long_fetch(long *target, int pe)
long long shmem_longlong_fetch(long long *target, int pe)
double shmem_double_fetch(long long *target, int pe)
float shmem_float_fetch(float *target, int pe)
Fortran
INCLUDE "mpp/shmem.fh"
INTEGER pe
INTEGER(KIND=4) SHMEM_INT4_FETCH, ires, target
ires = SHMEM_INT4_FETCH(target, pe)
INTEGER(KIND=8) SHMEM_INT8_FETCH, ires, target
ires = SHMEM_INT8_FETCH(target, pe)
REAL(KIND=4) SHMEM_INT4_FETCH, ires, target
ires = SHMEM_REAL4_FETCH(target, pe)
REAL(KIND=8) SHMEM_INT8_FETCH, ires, target
ires = SHMEM_REAL8_FETCH(target, pe)
πΈ DESCRIPTION πΈ
so the shmem_fetch girlies do an atomic fetch operation. they hand you back the contents of the target, and they do it atomically. like, no interruptions, no crumbs left behind, just vibes and correctness. π
the arguments, bestie, are:
targetβ the remotely accessible data object you're fetching from that remote PE. it's the whole point, honestly.peβ an integer that tells you which PE numbertargetis getting fetched from. and heads up if you're doing Fortran: it has to be a default integer value. that's not a suggestion, it's the rule. π
π RETURN VALUES π
you get the contents sitting at the target address on the remote PE. and the data type of the return value? same as the type of the remote data object. matching, iconic, as it should be. β¨
See also:
lowkey reminder: this is the atomic fetch, so the whole ~operation~ is the point. don't be out here expecting it to do anything other than return the contents of target atomically, because that is the entire assignment. π«Ά
Copyright 2003-2026, The Open MPI Community β periodt, they said it, I'm just passing the message along. π
and that's the whole page, bestie! dated Sep 10, 2026, brought to you by Open MPI. go fetch something atomically, you absolute legend. π¦β¨π
π¦ 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