SHMEM_SET(3)

✨ NAME ✨

okay so bestie, this is the whole little squad of atomic setter functions from Open MPI β€” shmem_double_set(3), shmem_float_set(3), shmem_int_set(3), shmem_long_set(3), shmem_longlong_set(3), shmem_int4_set(3), shmem_int8_set(3), shmem_real4_set(3), and shmem_real8_set(3). the way that they all do one thing: atomically set the value of a remote data object. iconic behavior honestly πŸ’…


✨ 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)

πŸŽ€ DESCRIPTION πŸŽ€

the set routines write value into the address target on pe as an atomic operation. no cap, it's giving "main character energy" β€” it just does the thing in one clean uninterrupted move and you don't gotta worry about anybody seeing a half-written value. πŸ¦‹

the arguments are as follows, bestie:

  • target β€” the remotely accessible data object to be set on the remote PE. like, that's the thing on the other end you're updating.
  • value β€” the value to be atomically written to the remote PE. this is the actual payload you're sending over.
  • pe β€” an integer that indicates the PE number upon which target is to be updated. if you're using Fortran, it must be a default integer value β€” so don't get cute with it, okay? πŸ™ˆ
ngl, "remotely accessible data object" is doing a lot of work in that sentence, but that's the whole vibe: you point at a thing on another PE, hand over a value, and the operation lands atomically. periodt.

πŸ’€ RETURN VALUES πŸ’€

NONE β€” literally nothing, bestie. these routines don't return a value. no exit status, no secret code, no little treat. just the atomic write and then they're gone.


🫢 SEE ALSO 🫢


🌸 okay that's the whole page!! this one is from Open MPI, and the footer energy is very much gitclone / Unreleased developer copy / SHMEM_SET(3) β€” so yeah, she's a developer-copy girly, not a polished release. still slay tho. πŸ’–βœ¨πŸ‘‘
πŸ“¦ where this page comes from