SHMEM_INT_SET(3)

✨ SHMEM_INT_SET ✨ β€” it's giving atomic remote vibes πŸ’…

okay bestie, so this is a whole lil family of routines from the Open MPI manual, and they all do the same iconic thing: yeet a value into a remote data object, atomically. no cap. 🫢

Meet the squad (all of these live on this one page, fr fr):

  • shmem_double_set
  • shmem_float_set
  • shmem_int_set
  • shmem_long_set
  • shmem_longlong_set
  • shmem_int4_set
  • shmem_int8_set
  • shmem_real4_set
  • shmem_real8_set

and collectively they're "Atomically sets the value of a remote data object." periodt. πŸ‘‘


🌸 SYNOPSIS 🌸

C or C++:

#include <mpp/shmem.h>

void shmem_double_set(double *target, double value, int pe)

void shmem_float_set(float *target, float value, int pe)

void shmem_int_set(int *target, int value, int pe)

void shmem_long_set(long *target, long value, int pe)

void shmem_longlong_set(long long *target, long long value, int pe)

Fortran:

INCLUDE "mpp/shmem.fh"

INTEGER pe

CALL SHMEM_INT4_SET(target, value, pe)
CALL SHMEM_INT8_SET(target, value, pe)
CALL SHMEM_REAL4_SET(target, value, pe)
CALL SHMEM_REAL8_SET(target, value, pe)

like, look at that include line bestie, mpp/shmem.h for the C/C++ girlies and mpp/shmem.fh for the Fortran icons πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so the set routines write the value into the address target on pe, and they do it as an atomic operation. as in, nobody's gonna catch it mid-write, it's a clean single move. main character energy, honestly.

the arguments, bestie, let me break them down for you:

  • target β€” the remotely accessible data object that's getting set on the remote PE. that's the lil spot on the other PE that's about to be blessed with a new value πŸ’–
  • value β€” the value that gets atomically written to the remote PE. the actual goods. the content. ✨
  • pe β€” an integer that says which PE number target is getting updated on. and heads up, if you're rolling with Fortran, it must be a default integer value. no fancy integer kinds, okay? πŸ™ˆ

πŸ’œ RETURN VALUES πŸ’œ

NONE

that's right. nothing. zero. it does its lil atomic thing and gives you absolutely nothing back. and that's on being unbothered. πŸ’…

✨ also see: intro_shmem(3) β€” go read it, iykyk

2003-2026, The Open MPI Community


okay that's the whole page, bestie! every option, every signature, every lil detail β€” all intact, all slaying 🌈 go forth and atomically set things. mwah πŸ’‹

Open MPI manual page, dated Sep 10, 2026 β€” source: the Open MPI project, and this page is SHMEM_INT_SET(3). take care of her πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from