SHMEM_INT_FETCH(3)

πŸ’– SHMEM_INT_FETCH πŸ’– the atomic fetch page πŸ¦‹

okay so bestie, welcome to the Open MPI manual β€” the page is SHMEM_INT_FETCH(3) and it's the group chat for the whole fetch squad:

one job, seven names, and the job is: atomically fetches the value of a remote data object ✨ 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)
copy these character for character, bestie. yes, even the long long one. I said what I said. 🫢

🌈 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 functions do one atomic fetch and that's it, that's the whole personality. they return the contents of the target as an atomic operation. it's giving main character energy, honestly. πŸ’…

and the arguments? okay so, the arguments are as follows:

  • target β€” the remotely accessible data object to be fetched from the remote PE. that's the thing you're grabbing, and it lives on somebody else's PE. 🌸
  • pe β€” an integer that indicates the PE number from which target is to be fetched. and if you're using Fortran, it must be a default integer value. no fancy kinds, bestie, default integer only. 😭

πŸŽ€ RETURN VALUES πŸŽ€

it hands you back the contents at the target address on the remote PE. 🫢

and the data type of the return value is the same as the type of the remote data object β€” they match, periodt. ✨


πŸ‘€ SEE ALSO πŸ‘€

go read that one too, iykyk. πŸ¦‹


this gorgeous piece of documentation is Β© 2003-2026, The Open MPI Community πŸ‘‘

sign-off time: this page dropped Sep 10, 2026, it's from the Open MPI manual (SHMEM_INT_FETCH(3), in case you scrolled past it πŸ’€), and that's the whole thing. stay atomic, stay slay. πŸ”₯πŸ’–βœ¨πŸŽ€πŸŒˆπŸ’…

πŸ“¦ where this page comes from