SHMEM_LONGLONG_FETCH(3)

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

πŸ’– 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:

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 number target is 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