@@ -16,15 +16,16 @@ $(_doc_external("MPI_Send"))
16
16
Send (data, comm:: Comm ; dest:: Integer , tag:: Integer = Cint (0 )) =
17
17
Send (data, dest, tag, comm)
18
18
19
-
20
- function Send (buf:: Buffer , dest:: Integer , tag:: Integer , comm:: Comm )
19
+ function Send (data:: Union{MPIPtr, MPIBuffertype} , count:: Integer , datatype:: Union{MPI_Datatype, Datatype} , dest:: Integer , tag:: Integer , comm:: Union{MPI_Comm, Comm} )
21
20
# int MPI_Send(const void* buf, int count, MPI_Datatype datatype, int dest,
22
21
# int tag, MPI_Comm comm)
23
22
@mpichk ccall ((:MPI_Send , libmpi), Cint,
24
23
(MPIPtr, Cint, MPI_Datatype, Cint, Cint, MPI_Comm),
25
- buf . data, buf . count, buf . datatype, dest, tag, comm)
24
+ data, count, datatype, dest, tag, comm)
26
25
return nothing
27
26
end
27
+ Send (buf:: Buffer , dest:: Integer , tag:: Integer , comm:: Comm ) =
28
+ Send (buf. data, buf. count, buf. datatype, dest, tag, comm. val)
28
29
Send (arr:: Union{Ref,AbstractArray} , dest:: Integer , tag:: Integer , comm:: Comm ) =
29
30
Send (Buffer (arr), dest, tag, comm)
30
31
function Send (obj:: T , dest:: Integer , tag:: Integer , comm:: Comm ) where T
@@ -60,14 +61,17 @@ $(_doc_external("MPI_Isend"))
60
61
"""
61
62
Isend (data, comm:: Comm ; dest:: Integer , tag:: Integer = 0 ) =
62
63
Isend (data, dest, tag, comm)
63
-
64
- function Isend (buf:: Buffer , dest:: Integer , tag:: Integer , comm:: Comm )
65
- req = Request ()
64
+ function Isend (data:: Union{MPIPtr, MPIBuffertype} , count:: Integer , datatype:: Union{MPI_Datatype, Datatype} , dest:: Integer , tag:: Integer , comm:: Union{MPI_Comm, Comm} , req:: Union{MPI_Request, Request} )
66
65
# int MPI_Isend(const void* buf, int count, MPI_Datatype datatype, int dest,
67
66
# int tag, MPI_Comm comm, MPI_Request *request)
68
67
@mpichk ccall ((:MPI_Isend , libmpi), Cint,
69
68
(MPIPtr, Cint, MPI_Datatype, Cint, Cint, MPI_Comm, Ptr{MPI_Request}),
70
- buf. data, buf. count, buf. datatype, dest, tag, comm, req)
69
+ data, count, datatype, dest, tag, comm, req)
70
+ return nothing
71
+ end
72
+ function Isend (buf:: Buffer , dest:: Integer , tag:: Integer , comm:: Comm )
73
+ req = Request ()
74
+ Isend (buf. data, buf. count, buf. datatype, dest, tag, comm, req)
71
75
req. buffer = buf
72
76
finalizer (free, req)
73
77
return req
@@ -113,12 +117,16 @@ $(_doc_external("MPI_Recv"))
113
117
Recv! (recvbuf, comm:: Comm , status= nothing ; source= Consts. MPI_ANY_SOURCE[], tag= Consts. MPI_ANY_TAG[]) =
114
118
Recv! (recvbuf, source, tag, comm, status)
115
119
116
- function Recv! (recvbuf :: Buffer , source:: Integer , tag:: Integer , comm:: Comm , status:: Union{Ref{Status},Nothing} )
120
+ function Recv! (data :: Union{MPIPtr, MPIBuffertype} , count :: Integer , datatype :: Union{MPI_Datatype, Datatype} , source:: Integer , tag:: Integer , comm:: Union{MPI_Comm, Comm} , status:: Union{Ref{Status}, Ptr{ Nothing} } )
117
121
# int MPI_Recv(void* buf, int count, MPI_Datatype datatype, int source,
118
122
# int tag, MPI_Comm comm, MPI_Status *status)
119
123
@mpichk ccall ((:MPI_Recv , libmpi), Cint,
120
124
(MPIPtr, Cint, MPI_Datatype, Cint, Cint, MPI_Comm, Ptr{Status}),
121
- recvbuf. data, recvbuf. count, recvbuf. datatype, source, tag, comm, something (status, Consts. MPI_STATUS_IGNORE[]))
125
+ data, count, datatype, source, tag, comm, status)
126
+ return nothing
127
+ end
128
+ function Recv! (recvbuf:: Buffer , source:: Integer , tag:: Integer , comm:: Comm , status:: Union{Ref{Status},Nothing} )
129
+ Recv! (recvbuf. data, recvbuf. count, recvbuf. datatype, source, tag, comm, something (status, Consts. MPI_STATUS_IGNORE[]))
122
130
return recvbuf. data
123
131
end
124
132
Recv! (recvbuf, source:: Integer , tag:: Integer , comm:: Comm , status:: Union{Ref{Status},Nothing} ) =
@@ -204,13 +212,19 @@ $(_doc_external("MPI_Irecv"))
204
212
"""
205
213
Irecv! (recvbuf, comm:: Comm ; source:: Integer = Consts. MPI_ANY_SOURCE[], tag:: Integer = Consts. MPI_ANY_TAG[]) =
206
214
Irecv! (recvbuf, source, tag, comm)
207
- function Irecv! (buf:: Buffer , source:: Integer , tag:: Integer , comm:: Comm )
208
- req = Request ()
215
+ function Irecv! (data:: Union{MPIPtr, MPIBuffertype} , count:: Integer , datatype:: Union{MPI_Datatype, Datatype} , source:: Integer , tag:: Integer , comm:: Union{MPI_Comm, Comm} , req:: Union{MPI_Request, Request} )
209
216
# int MPI_Irecv(void* buf, int count, MPI_Datatype datatype, int source,
210
217
# int tag, MPI_Comm comm, MPI_Request *request)
211
218
@mpichk ccall ((:MPI_Irecv , libmpi), Cint,
212
219
(MPIPtr, Cint, MPI_Datatype, Cint, Cint, MPI_Comm, Ptr{MPI_Request}),
213
- buf. data, buf. count, buf. datatype, source, tag, comm, req)
220
+ data, count, datatype, source, tag, comm, req)
221
+ return nothing
222
+ end
223
+ Irecv! (buf:: Buffer , source:: Integer , tag:: Integer , comm:: Comm , req:: Request ) =
224
+ Irecv! (buf. data, buf. count, buf. datatype, source, tag, comm, req)
225
+ function Irecv! (buf:: Buffer , source:: Integer , tag:: Integer , comm:: Comm )
226
+ req = Request ()
227
+ Irecv! (buf. data, buf. count, buf. datatype, source, tag, comm, req)
214
228
req. buffer = buf
215
229
finalizer (free, req)
216
230
return req
@@ -249,20 +263,27 @@ $(_doc_external("MPI_Sendrecv"))
249
263
"""
250
264
Sendrecv! (sendbuf, recvbuf, comm:: MPI.Comm , status= nothing ; dest:: Integer , sendtag:: Integer = 0 , source:: Integer = Consts. MPI_ANY_SOURCE[], recvtag:: Integer = Consts. MPI_ANY_TAG[]) =
251
265
Sendrecv! (sendbuf, dest, sendtag, recvbuf, source, recvtag, comm, status)
252
-
253
- function Sendrecv! (sendbuf:: Buffer , dest:: Integer , sendtag:: Integer ,
254
- recvbuf:: Buffer , source:: Integer , recvtag:: Integer ,
255
- comm:: Comm , status:: Union{Ref{Status}, Nothing} )
266
+ function Sendrecv! (sendbuf:: Union{MPIPtr, MPIBuffertype} , sendcount:: Integer , sendtype:: Union{MPI_Datatype, Datatype} , dest:: Integer , sendtag:: Integer ,
267
+ recvbuf:: Union{MPIPtr, MPIBuffertype} , recvcount:: Integer , recvtype:: Union{MPI_Datatype, Datatype} , source:: Integer , recvtag:: Integer ,
268
+ comm:: Union{MPI_Comm, Comm} , status:: Union{Ref{Status}, Ptr{Nothing}} )
256
269
# int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, int dest, int sendtag,
257
270
# void *recvbuf, int recvcount, MPI_Datatype recvtype, int source, int recvtag,
258
271
# MPI_Comm comm, MPI_Status *status)
259
272
@mpichk ccall ((:MPI_Sendrecv , libmpi), Cint,
260
273
(MPIPtr, Cint, MPI_Datatype, Cint, Cint,
261
274
MPIPtr, Cint, MPI_Datatype, Cint, Cint,
262
275
MPI_Comm, Ptr{Status}),
263
- sendbuf. data, sendbuf. count, sendbuf. datatype, dest, sendtag,
264
- recvbuf. data, recvbuf. count, recvbuf. datatype, source, recvtag,
265
- comm, something (status, Consts. MPI_STATUS_IGNORE[]))
276
+ sendbuf, sendcount, sendtype, dest, sendtag,
277
+ recvbuf, recvcount, recvtype, source, recvtag,
278
+ comm, status)
279
+ return nothing
280
+ end
281
+ function Sendrecv! (sendbuf:: Buffer , dest:: Integer , sendtag:: Integer ,
282
+ recvbuf:: Buffer , source:: Integer , recvtag:: Integer ,
283
+ comm:: Comm , status:: Union{Ref{Status}, Nothing} )
284
+ Sendrecv! (sendbuf. data, sendbuf. count, sendbuf. datatype, dest, sendtag,
285
+ recvbuf. data, recvbuf. count, recvbuf. datatype, source, recvtag,
286
+ comm, something (status, Consts. MPI_STATUS_IGNORE[]))
266
287
return recvbuf. data
267
288
end
268
289
Sendrecv! (sendbuf, dest:: Integer , sendtag:: Integer , recvbuf, source:: Integer , recvtag:: Integer , comm:: Comm , status:: Union{Ref{Status}, Nothing} ) =
0 commit comments