SHMEM_QUIET(3)

πŸ’… SHMEM_QUIET(3) β€” the Open MPI glow-up

okay bestie, sit down, hydrate, and let me tell you about shmem_quiet(3) from Open MPI, because this little function is lowkey the backbone of "did my data actually arrive" energy ✨


🌸 NAME 🌸

shmem_quiet(3) β€” it waits for ALL the outstanding remote writes from a processing element (PE) to finish. like, all of them. no stragglers. periodt πŸ’–


✨ SYNOPSIS ✨

C or C++:

#include <mpp/shmem.h>

void shmem_quiet(void)

Fortran:

CALL SHMEM_QUIET

see how refreshingly short that is? iconic. no args, no drama, no notes πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it actually DO. shmem_quiet makes sure your put (remote write) operations are ordered. Every single put operation you issued to any processing element (PE) before you called shmem_quiet is guaranteed to be visible to all the other PEs β€” and that guarantee lands no later than any subsequent memory load or store, any remote put or get, or any synchronization operations that come after the call to shmem_quiet.

translation: you call it, and the universe (of your PEs) is caught up. no cap πŸ”₯


πŸ‘‘ NOTES πŸ‘‘

  • shmem_quiet is most useful as a way of making sure a whole bunch of put operations get delivered in order. like, example: you might use shmem_quiet to await delivery of a block of data before you issue another put, which sets a completion flag on another PE. very "wait for the vibes to settle, then signal" of you πŸ’œ
  • shmem_quiet is not usually needed if shmem_barrier_all(3) or shmem_barrier(3) are being called. because the barrier routines? they already wait for the completion of outstanding remote writes (puts). they're doing the work so you don't have to 🫢

🌈 EXAMPLES 🌈

PROGRAM COMPFLAG
  INCLUDE "mpp/shmem.fh"

  INTEGER FLAG_VAR, ARRAY(100), RECEIVER, SENDER
  COMMON/FLAG/FLAG_VAR
  COMMON/DATA/ARRAY
  INTRINSIC MY_PE

  FLAG_VAR = 0
  CALL SHMEM_BARRIER_ALL ! wait for FLAG_VAR to be initialized
  SENDER = 0                        ! PE 0 sends the data
  RECEIVER = 1                      ! PE 1 receives the data

  IF (MY_PE() .EQ. 0) THEN
    ARRAY = 33
    CALL SHMEM_PUT(ARRAY, ARRAY, 100, RECEIVER) ! start sending data
    CALL SHMEM_QUIET                ! wait for delivery
    CALL SHMEM_PUT(FLAG_VAR, 1, 1, RECEIVER) ! send completion flag
  ELSE IF (MY_PE() .EQ. RECEIVER) THEN
    CALL SHMEM_UDCFLUSH
    CALL SHMEM_WAIT(FLAG_VAR, 0)
    PRINT *,ARRAY                       ! ARRAY has been delivered
  ENDIF
END

See also:

intro_shmem(3) shmem_barrier(3) shmem_barrier_all(3) shmem_fence(3) shmem_put(3) shmem_wait(3)

ngl, that example is the whole plot: PE 0 ships the data, calls shmem_quiet so the data is actually there, THEN ships the completion flag. PE 1 flushes, waits on the flag, and prints. the ordering is the main character, periodt πŸ”₯

2003-2026, The Open MPI Community


okay that's the whole page, no gatekeeping πŸ’… this is SHMEM_QUIET(3) from the Open MPI manual, dated Sep 10, 2026, brought to you by the fine humans of the Open MPI Community (2003-2026). go forth and synchronize responsibly, bestie 🧚✨

πŸ“¦ where this page comes from