File: shmem_long_wait.3

package info (click to toggle)
openmpi 5.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,684 kB
  • sloc: ansic: 613,078; makefile: 42,353; sh: 11,194; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,179; python: 1,859; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (266 lines) | stat: -rw-r--r-- 6,698 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
.\" Man page generated from reStructuredText.
.
.TH "SHMEM_LONG_WAIT" "3" "May 30, 2025" "" "Open MPI"
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.INDENT 0.0
.INDENT 3.5
.UNINDENT
.UNINDENT
.sp
\fI\%shmem_int_wait\fP(3), \fI\%shmem_int_wait\fP(3)_until,
shmem_int4_wait(3), shmem_int4_wait(3)_until,
shmem_int8_wait(3), shmem_int8_wait(3)_until,
\fI\%shmem_long_wait\fP(3), \fI\%shmem_long_wait\fP(3)_until,
\fI\%shmem_longlong_wait\fP(3), \fI\%shmem_longlong_wait\fP(3)_until,
\fI\%shmem_short_wait\fP(3), \fI\%shmem_short_wait\fP(3)_until,
\fI\%shmem_wait\fP(3), \fI\%shmem_wait\fP(3)_until \- Waits for a variable on the
local processing element (PE) to change
.SH SYNOPSIS
.sp
C or C++:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft 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)
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Fortran:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
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)
.ft P
.fi
.UNINDENT
.UNINDENT
.SH DESCRIPTION
.sp
\fI\%shmem_wait\fP and \fI\%shmem_wait_until\fP wait for \fBivar\fP to be changed by a
remote write or atomic swap issued by a different processor. These
routines can be used for point\-to\- point directed synchronization. A
call to \fI\%shmem_wait\fP does not return until some other processor writes a
value, not equal to cmp_value, into \fBivar\fP on the waiting processor. A
call to \fI\%shmem_wait_until\fP does not return until some other processor
changes \fBivar\fP to satisfy the condition implied by cmp and cmp_value.
This mechanism is useful when a processor needs to tell another
processor that it has completed some action.
.sp
The arguments are as follows:
.INDENT 0.0
.TP
.B target
The remotely accessible integer data object to be updated on the
remote PE. If you are using C/C++, the type of target should match
that implied in the SYNOPSIS section. If you are using the Fortran
compiler, it must be of type integer with an element size of 4 bytes
for SHMEM_INT4_ADD and 8 bytes for SHMEM_INT8_ADD.
.TP
.B value
The value to be atomically added to target. If you are using C/C++,
the type of value should match that implied in the SYNOPSIS section.
If you are using Fortran, it must be of type integer with an element
size of target.
.TP
.B pe
An integer that indicates the PE number upon which target is to be
updated. If you are using Fortran, it must be a default integer
value.
.TP
.B ivar
A remotely accessible integer variable that is being updated by
another PE. If you are using C/C++, the type of ivar should match
that implied in the SYNOPSIS section. If you are using Fortran, ivar
must be a specific sized integer type according to the function being
called, as follows:
.sp
\fI\%shmem_wait\fP, \fI\%shmem_wait_until\fP:** default INTEGER
.sp
shmem_int4_wait, shmem_int4_wait_until:** INTEGER*4
.sp
shmem_int8_wait, shmem_int8_wait_until:** INTEGER*8
.TP
.B cmp
The compare operator that compares ivar with cmp_value. cmp must be
of type integer. If you are using Fortran, it must be of default
kind. If you are using C/C++, the type of cmp should match that
implied in the SYNOPSIS section. The following cmp values are
supported:
.INDENT 7.0
.TP
.B SHMEM_CMP_EQ
Equal
.TP
.B SHMEM_CMP_NE
Not equal
.TP
.B SHMEM_CMP_GT
Greater than
.TP
.B SHMEM_CMP_LE
Less than or equal to
.TP
.B SHMEM_CMP_LT
Less than
.TP
.B SHMEM_CMP_GE
Greater than or equal to
.UNINDENT
.TP
.B cmp_value
cmp_value must be of type integer. If you are using C/C++, the type
of cmp_value should match thatimplied in the SYNOPSIS section. If you
are using Fortran, cmp_value must be an integer of the same size and
kind as ivar. The \fI\%shmem_wait\fP routines return when ivar is no longer
equal to cmp_value. The \fI\%shmem_wait_until\fP routines return when the
compare condition is true. The compare condition is defined by the
ivar argument compared with the cmp_value using the comparison
operator, cmp.
.UNINDENT
.SH EXAMPLES
.sp
\fBExample 1:\fP The following call returns when variable ivar is not
equal to 100:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
INTEGER*8 IVAR

CALL SHMEM_INT8_WAIT(IVAR, INT8(100))
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBExample 2:\fP The following call to SHMEM_INT8_WAIT_UNTIL is equivalent
to the call to SHMEM_INT8_WAIT in example 1:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
INTEGER*8 IVAR

CALL SHMEM_INT8_WAIT_UNTIL(IVAR, SHMEM_CMP_NE, INT8(100))
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBExample 3:\fP The following C/C++ call waits until the sign bit in ivar
is set by a transfer from a remote PE:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
int ivar;

shmem_int_wait_until(&ivar, SHMEM_CMP_LT, 0);
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBExample 4:\fP The following Fortran example is in the context of a
subroutine:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
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
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBSEE ALSO:\fP
.INDENT 0.0
.INDENT 3.5
\fIintro_shmem\fP(3) \fIshmem_put\fP(3)
.UNINDENT
.UNINDENT
.SH COPYRIGHT
2003-2025, The Open MPI Community
.\" Generated by docutils manpage writer.
.