SHMEM_INT_WAIT_UNTIL(3)
π SHMEM_INT_WAIT_UNTIL(3) π (the Open MPI girlies know)
okay bestie, so this is one of the Open MPI manpages, and it's literally about waiting for a variable on your local processing element (PE) to change. That's the whole vibe. π¦
Here's the whole squad of functions this page covers:
shmem_int_waitshmem_int_wait_untilshmem_int4_waitshmem_int4_wait_untilshmem_int8_waitshmem_int8_wait_untilshmem_long_waitshmem_long_wait_untilshmem_longlong_waitshmem_longlong_wait_untilshmem_short_waitshmem_short_wait_untilshmem_waitshmem_wait_until
and they all wait for a variable on the local processing element (PE) to change. periodt. β¨
β¨ SYNOPSIS β¨
C or C++:
#include <mpp/shmem.h>
void shmem_int_wait(volatile int *var, int value)
void shmem_int_wait_until(volatile int *var, int cond, int value)
void shmem_long_wait(volatile long *var, long value)
void shmem_long_wait_until(volatile long *var, int cond, long value)
void shmem_longlong_wait(volatile long long *var, long long value)
void shmem_longlong_wait_until(volatile long long *var, int cond,
long long value)
void shmem_short_wait(volatile short *var, short value)
void shmem_short_wait_until(volatile short *var, int cond,
short value)
void shmem_wait(volatile long *ivar, long cmp_value)
void shmem_wait_until(volatile long *ivar, int cmp, long value)
Fortran:
INCLUDE "mpp/shmem.fh"
CALL SHMEM_INT4_WAIT(ivar, cmp_value)
CALL SHMEM_INT4_WAIT_UNTIL(ivar, cmp, cmp_value)
CALL SHMEM_INT8_WAIT(ivar, cmp_value)
CALL SHMEM_INT8_WAIT_UNTIL(ivar, cmp, cmp_value)
CALL SHMEM_WAIT(ivar, cmp_value)
CALL SHMEM_WAIT_UNTIL(ivar, cmp, cmp_value)
πΈ DESCRIPTION πΈ
so shmem_wait and shmem_wait_until are out here waiting for ivar to get changed by a remote write or an atomic swap issued by a different processor. it's giving point-to-point directed synchronization, and honestly? iconic. π
here's the tea:
- a call to
shmem_waitdoes not return until some other processor writes a value, not equal tocmp_value, intoivaron the waiting processor. - a call to
shmem_wait_untildoes not return until some other processor changesivarto satisfy the condition implied bycmpandcmp_value.
this mechanism is useful when a processor needs to tell another processor that it has completed some action. communication, but make it β¨synchronizedβ¨.
The arguments are as follows:
- target β The remotely accessible integer data object to be updated on the remote PE. If you are using C/C++, the type of
targetshould match that implied in the SYNOPSIS section. If you are using the Fortran compiler, it must be of typeintegerwith an element size of 4 bytes forSHMEM_INT4_ADDand 8 bytes forSHMEM_INT8_ADD. - value β The value to be atomically added to
target. If you are using C/C++, the type ofvalueshould match that implied in the SYNOPSIS section. If you are using Fortran, it must be of typeintegerwith an element size oftarget. - pe β An integer that indicates the PE number upon which
targetis to be updated. If you are using Fortran, it must be a defaultintegervalue. - ivar β A remotely accessible integer variable that is being updated by another PE. If you are using C/C++, the type of
ivarshould match that implied in the SYNOPSIS section. If you are using Fortran,ivarmust be a specific sized integer type according to the function being called, as follows:shmem_wait,shmem_wait_until: defaultINTEGERshmem_int4_wait,shmem_int4_wait_until:INTEGER*4shmem_int8_wait,shmem_int8_wait_until:INTEGER*8
- cmp β The compare operator that compares
ivarwithcmp_value.cmpmust be of typeinteger. If you are using Fortran, it must be of default kind. If you are using C/C++, the type ofcmpshould match that implied in the SYNOPSIS section. The followingcmpvalues are supported:SHMEM_CMP_EQβ EqualSHMEM_CMP_NEβ Not equalSHMEM_CMP_GTβ Greater thanSHMEM_CMP_LEβ Less than or equal toSHMEM_CMP_LTβ Less thanSHMEM_CMP_GEβ Greater than or equal to
- cmp_value β
cmp_valuemust be of typeinteger. If you are using C/C++, the type ofcmp_valueshould match that implied in the SYNOPSIS section. If you are using Fortran,cmp_valuemust be anintegerof the same size and kind asivar. Theshmem_waitroutines return whenivaris no longer equal tocmp_value. Theshmem_wait_untilroutines return when the compare condition is true. The compare condition is defined by theivarargument compared with thecmp_valueusing the comparison operator,cmp.
π EXAMPLES π
Example 1: The following call returns when variable ivar is not equal to 100:
INTEGER*8 IVAR
CALL SHMEM_INT8_WAIT(IVAR, INT8(100))
Example 2: The following call to SHMEM_INT8_WAIT_UNTIL is equivalent to the call to SHMEM_INT8_WAIT in example 1:
INTEGER*8 IVAR
CALL SHMEM_INT8_WAIT_UNTIL(IVAR, SHMEM_CMP_NE, INT8(100))
Example 3: The following C/C++ call waits until the sign bit in ivar is set by a transfer from a remote PE:
int ivar;
shmem_int_wait_until(&ivar, SHMEM_CMP_LT, 0);
Example 4: The following Fortran example is in the context of a subroutine:
SUBROUTINE EXAMPLE()
INTEGER FLAG_VAR
COMMON/FLAG/FLAG_VAR
. . .
FLAG_VAR = FLAG_VALUE ! initialize the event variable
. . .
IF (FLAG_VAR .EQ. FLAG_VALUE) THEN
CALL SHMEM_WAIT(FLAG_VAR, FLAG_VALUE)
ENDIF
FLAG_VAR = FLAG_VALUE ! reset the event variable for next time
. . .
END
π«Ά SEE ALSO π«Ά
intro_shmem(3)shmem_put(3)
π COPYRIGHT π
2003-2026, The Open MPI Community
π ngl, thetarget/value/peargs lowkey wandered in from a different function's page, but they're part of this manpage so we're keeping them, bestie. no edits, no cap. π
okay that's the whole thing fr fr β this was the Open MPI SHMEM_INT_WAIT_UNTIL(3) page, dated Sep 10, 2026, brought to you by the Open MPI girlies. go let your variables change. ππΈβ¨
π¦ where this page comes from
- ubuntu stonking: openmpi-doc 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms